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
323           $type  = 'text';
324      }
325 ?>
326 <form method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"<?php
327      /**
328       * Fires inside the adduser form tag.
329       *
330       * @since 3.0.0
331       */
332      do_action( 'user_new_form_tag' );
333 ?>>
334 <input name="action" type="hidden" value="adduser" />
335 <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
336
337 <table class="form-table">
338      <tr class="form-field form-required">
339           <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th>
340           <td><input name="email" type="<?php echo $type; ?>" id="adduser-email" class="wp-suggest-user" value="" /></td>
341      </tr>
 
Line Code
376 } // is_multisite()
377
378 if ( current_user_can( 'create_users') ) {
379      if ( $do_both )
380           echo '<h2 id="create-new-user">' . __( 'Add New User' ) . '</h2>';
381 ?>
382 <p><?php _e('Create a brand new user and add them to this site.'); ?></p>
383 <form method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"<?php
384      /** This action is documented in wp-admin/user-new.php */
385      do_action( 'user_new_form_tag' );
386 ?>>
387 <input name="action" type="hidden" value="createuser" />
388 <?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
389 <?php
390 // Load up the passed data, else set to a default.
391 $creating = isset( $_POST['createuser'] );
392
393 $new_user_login = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : '';
394 $new_user_firstname = $creating && isset( $_POST['first_name'] ) ? wp_unslash( $_POST['first_name'] ) : '';