Make WordPress Core

Ticket #18709: 18709.2.patch

File 18709.2.patch, 2.6 KB (added by strangerstudios, 11 years ago)

user_new_form_before and user_new_form_after hooks

  • wp-admin/user-new.php

     
    269269<form action="" method="post" name="adduser" id="adduser" class="validate"<?php do_action('user_new_form_tag');?>>
    270270<input name="action" type="hidden" value="adduser" />
    271271<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
    272 
     272<?php do_action( 'user_new_form_before' ); ?>
    273273<table class="form-table">
    274274        <tr class="form-field form-required">
    275275                <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th>
     
    289289        </tr>
    290290<?php } ?>
    291291</table>
     292<?php do_action( 'user_new_form_after' ); ?>
    292293<?php submit_button( __( 'Add Existing User '), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?>
    293294</form>
    294295<?php
     
    301302<p><?php _e('Create a brand new user and add it to this site.'); ?></p>
    302303<form action="" method="post" name="createuser" id="createuser" class="validate"<?php do_action('user_new_form_tag');?>>
    303304<input name="action" type="hidden" value="createuser" />
    304 <?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ) ?>
    305 <?php
     305<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
     306<?php do_action( 'user_new_form_before' );
     307
    306308// Load up the passed data, else set to a default.
    307309foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_name' => 'lastname',
    308310                                'email' => 'email', 'url' => 'uri', 'role' => 'role', 'send_password' => 'send_password', 'noconfirmation' => 'ignore_pass' ) as $post_field => $var ) {
     
    380382        <?php } ?>
    381383</table>
    382384
     385<?php do_action( 'user_new_form_after' ); ?>
     386
    383387<?php submit_button( __( 'Add New User '), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?>
    384388
    385389</form>
  • wp-admin/network/user-new.php

     
    8686        </div>
    8787<?php } ?>
    8888        <form action="<?php echo network_admin_url('user-new.php?action=add-user'); ?>" id="adduser" method="post">
     89        <?php do_action( 'user_new_form_before' ); ?>
    8990        <table class="form-table">
    9091                <tr class="form-field form-required">
    9192                        <th scope="row"><?php _e( 'Username' ) ?></th>
     
    99100                        <td colspan="2"><?php _e( 'Username and password will be mailed to the above email address.' ) ?></td>
    100101                </tr>
    101102        </table>
     103        <?php do_action( 'user_new_form_after' ); ?>
    102104        <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
    103105        <?php submit_button( __('Add User'), 'primary', 'add-user' ); ?>
    104106        </form>