Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: user_new_form_tag

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
336           $type  = 'text';
337      }
338 ?>
339 <form method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"<?php
340      /**
341       * Fires inside the adduser form tag.
342       *
343       * @since 3.0.0
344       */
345      do_action( 'user_new_form_tag' );
346 ?>>
347 <input name="action" type="hidden" value="adduser" />
348 <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
349
350 <table class="form-table">
351      <tr class="form-field form-required">
352           <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th>
353           <td><input name="email" type="<?php echo $type; ?>" id="adduser-email" class="wp-suggest-user" value="" /></td>
354      </tr>
 
Line Code
389 } // is_multisite()
390
391 if ( current_user_can( 'create_users') ) {
392      if ( $do_both )
393           echo '<h2 id="create-new-user">' . __( 'Add New User' ) . '</h2>';
394 ?>
395 <p><?php _e('Create a brand new user and add them to this site.'); ?></p>
396 <form method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"<?php
397      /** This action is documented in wp-admin/user-new.php */
398      do_action( 'user_new_form_tag' );
399 ?>>
400 <input name="action" type="hidden" value="createuser" />
401 <?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
402 <?php
403 // Load up the passed data, else set to a default.
404 $creating = isset( $_POST['createuser'] );
405
406 $new_user_login = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : '';
407 $new_user_firstname = $creating && isset( $_POST['first_name'] ) ? wp_unslash( $_POST['first_name'] ) : '';