Multisite: Add 'invite_user' action that fires immediately after a user is invited to join a site, but before the notification is sent.

props ebinnion, MikeHansenMe, DrewAPicture.
fixes #33008.

git-svn-id: https://develop.svn.wordpress.org/trunk@33732 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-08-25 17:47:26 +00:00
parent 40ce8c68fe
commit b59d10ccac

View File

@ -79,6 +79,18 @@ if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) {
$roles = get_editable_roles();
$role = $roles[ $_REQUEST['role'] ];
/**
* Fires immediately after a user is invited to join a site, but before the notification is sent.
*
* @since 4.4.0
*
* @param int $user_id The invited user's ID.
* @param array $role The role of invited user.
* @param string $newuser_key The key of the invitation.
*/
do_action( 'invite_user', $user_id, $role, $newuser_key );
/* translators: 1: Site name, 2: site URL, 3: role, 4: activation URL */
$message = __( 'Hi,