invite_user
Fires immediately after a user is invited to join a site, but before the notification is sent.
Description
Parameters (3)
- 0. $user_id (int)
- The invited user's ID.
- 1. $role (array)
- The role of invited user.
- 2. $newuser_key (string)
- The key of the invitation.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'invite_user', $user_id, $role, $newuser_key );
- The following example is for adding a hook callback.
- // define the invite_user callback
- function action_invite_user( $user_id, $role, $newuser_key ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'invite_user', 'action_invite_user', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'invite_user', 'action_invite_user', 10, 3 );
Defined (1)
The action is defined in the following location(s).
- /wp-admin/user-new.php
- do_action( 'invite_user', $user_id, $role, $newuser_key );