Users: Allow to create users without sending an email to the new user.

This adds a checkbox to `wp-admin/user-new.php` to prevent sending an email with the username and a password reset link to the new user. Restores the behavior of pre-4.3.

Fixes #33504.
Props tharsheblows, SergeyBiryukov, DrewAPicture, ocean90.

git-svn-id: https://develop.svn.wordpress.org/trunk@35742 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90)
2015-11-25 22:37:35 +00:00
parent 6b37ee4b48
commit daa3fe4d26
4 changed files with 17 additions and 8 deletions

View File

@@ -176,14 +176,18 @@ function edit_user( $user_id = 0 ) {
$user_id = wp_update_user( $user );
} else {
$user_id = wp_insert_user( $user );
$notify = isset( $_POST['send_user_notification'] ) ? 'both' : 'admin';
/**
* Fires after a new user has been created.
*
* @since 4.4.0
*
* @param int $user_id ID of the newly created user.
* @param int $user_id ID of the newly created user.
* @param string $notify Type of notification that should happen. See {@see wp_send_new_user_notifications()}
* for more information on possible values.
*/
do_action( 'edit_user_created_user', $user_id );
do_action( 'edit_user_created_user', $user_id, $notify );
}
return $user_id;
}