mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 19:24:34 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user