Add a user_new_form
hook, with context. props johnjamesjacoby, strangerstudios, jeremyfelt, DrewAPicture. fixes #18709.
git-svn-id: https://develop.svn.wordpress.org/trunk@25629 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f7a6959048
commit
57241c4824
@ -99,6 +99,10 @@ if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) { ?>
|
||||
<td colspan="2"><?php _e( 'Username and password will be mailed to the above email address.' ) ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
//duplicate_hook
|
||||
do_action( 'user_new_form', 'add-new-user' );
|
||||
?>
|
||||
<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
|
||||
<?php submit_button( __('Add User'), 'primary', 'add-user' ); ?>
|
||||
</form>
|
||||
|
@ -310,6 +310,20 @@ if ( is_multisite() ) {
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<?php
|
||||
/**
|
||||
* Fires at the end of the new user form.
|
||||
*
|
||||
* Passes a contextual string to make both types of new user forms
|
||||
* uniquely targetable. Contexts are 'add-existing-user' (Multisite),
|
||||
* and 'add-new-user' (single site and network admin).
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param string A contextual string specifying which type of new user form the hook follows.
|
||||
*/
|
||||
do_action( 'user_new_form', 'add-existing-user' );
|
||||
?>
|
||||
<?php submit_button( __( 'Add Existing User '), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?>
|
||||
</form>
|
||||
<?php
|
||||
@ -325,7 +339,7 @@ if ( current_user_can( 'create_users') ) {
|
||||
?>
|
||||
<form action="" method="post" name="createuser" id="createuser" class="validate"<?php do_action('user_new_form_tag');?>>
|
||||
<input name="action" type="hidden" value="createuser" />
|
||||
<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ) ?>
|
||||
<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
|
||||
<?php
|
||||
// Load up the passed data, else set to a default.
|
||||
foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_name' => 'lastname',
|
||||
@ -412,6 +426,11 @@ if ( apply_filters( 'show_password_fields', true ) ) : ?>
|
||||
<?php } ?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
//duplicate_hook
|
||||
do_action( 'user_new_form', 'add-new-user' );
|
||||
?>
|
||||
|
||||
<?php submit_button( __( 'Add New User '), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?>
|
||||
|
||||
</form>
|
||||
|
Loading…
Reference in New Issue
Block a user