user_new_form

Fires at the end of the new user form.

Description

do_action( 'user_new_form', (string) $add_existing_user ); 

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).

Parameters (1)

0. $add_existing_user (string) => 'add-existing-user'
A contextual string specifying which type of new user form the hook follows.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'user_new_form', $add_existing_user ); 
The following example is for adding a hook callback.
  1. // define the user_new_form callback 
  2. function action_user_new_form( $add_existing_user ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'user_new_form', 'action_user_new_form', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'user_new_form', 'action_user_new_form', 10, 1 ); 

Defined (2)

The action is defined in the following location(s).

/wp-admin/user-new.php  
  1. do_action( 'user_new_form', 'add-existing-user' ); 
  1. do_action( 'user_new_form', 'add-new-user' );