diff --git src/wp-admin/includes/user.php src/wp-admin/includes/user.php
index 5c12d3d..906f5ca 100644
|
|
|
function edit_user( $user_id = 0 ) { |
| 176 | 176 | $user_id = wp_update_user( $user ); |
| 177 | 177 | } else { |
| 178 | 178 | $user_id = wp_insert_user( $user ); |
| 179 | | wp_new_user_notification( $user_id, 'both' ); |
| | 179 | /** |
| | 180 | * Fires after a new user has been created. |
| | 181 | * |
| | 182 | * @since 4.4.0 |
| | 183 | * |
| | 184 | * @param int $user_id ID of the newly created user. |
| | 185 | */ |
| | 186 | do_action( 'edit_user_created_user', $user_id ); |
| 180 | 187 | } |
| 181 | 188 | return $user_id; |
| 182 | 189 | } |
| … |
… |
this email. This invitation will expire in a few days. |
| 503 | 510 | |
| 504 | 511 | Please click the following link to activate your user account: |
| 505 | 512 | %%s' ), get_bloginfo( 'name' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ) ); |
| 506 | | } |
| 507 | | No newline at end of file |
| | 513 | } |
diff --git src/wp-admin/network/site-new.php src/wp-admin/network/site-new.php
index c5fa157..18088b7 100644
|
|
|
if ( wp_validate_action( 'add-site' ) ) { |
| 91 | 91 | if ( !$user_id ) { // Create a new user with a random password |
| 92 | 92 | $password = wp_generate_password( 12, false ); |
| 93 | 93 | $user_id = wpmu_create_user( $domain, $password, $email ); |
| 94 | | if ( false === $user_id ) |
| | 94 | if ( false === $user_id ) { |
| 95 | 95 | wp_die( __( 'There was an error creating the user.' ) ); |
| 96 | | else |
| 97 | | wp_new_user_notification( $user_id, 'both' ); |
| | 96 | } |
| | 97 | |
| | 98 | /** |
| | 99 | * Fires after a new user has been created via the network site-new.php page. |
| | 100 | * |
| | 101 | * @since 4.4.0 |
| | 102 | * |
| | 103 | * @param int $user_id ID of the newly created user. |
| | 104 | */ |
| | 105 | do_action( 'network_site_new_created_user', $user_id ); |
| 98 | 106 | } |
| 99 | 107 | |
| 100 | 108 | $wpdb->hide_errors(); |
diff --git src/wp-admin/network/site-users.php src/wp-admin/network/site-users.php
index eb692f5..d27c79e 100644
|
|
|
if ( $action ) { |
| 77 | 77 | if ( false === $user_id ) { |
| 78 | 78 | $update = 'err_new_dup'; |
| 79 | 79 | } else { |
| 80 | | wp_new_user_notification( $user_id, 'both' ); |
| 81 | 80 | add_user_to_blog( $id, $user_id, $_POST['new_role'] ); |
| 82 | 81 | $update = 'newuser'; |
| | 82 | /** |
| | 83 | * Fires after a user has been created via the network site-users.php page. |
| | 84 | * |
| | 85 | * @since 4.4.0 |
| | 86 | * |
| | 87 | * @param int $user_id ID of the newly created user. |
| | 88 | */ |
| | 89 | do_action( 'network_site_users_created_user', $user_id ); |
| 83 | 90 | } |
| 84 | 91 | } |
| 85 | 92 | break; |
diff --git src/wp-admin/network/user-new.php src/wp-admin/network/user-new.php
index f2ccbb8..e0bdbe5 100644
|
|
|
if ( wp_validate_action( 'add-user' ) ) { |
| 51 | 51 | if ( ! $user_id ) { |
| 52 | 52 | $add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) ); |
| 53 | 53 | } else { |
| 54 | | wp_new_user_notification( $user_id, 'both' ); |
| | 54 | /** |
| | 55 | * Fires after a new user has been created. |
| | 56 | * |
| | 57 | * @since 4.4.0 |
| | 58 | * |
| | 59 | * @param int $user_id ID of the newly created user. |
| | 60 | */ |
| | 61 | do_action( 'network_user_new_created_user', $user_id ); |
| 55 | 62 | wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) ); |
| 56 | 63 | exit; |
| 57 | 64 | } |
diff --git src/wp-includes/default-filters.php src/wp-includes/default-filters.php
index 3d3c2f0..e7303a9 100644
|
|
|
add_action( 'wp_split_shared_term_batch', '_wp_batch_split_terms' ); |
| 338 | 338 | add_action( 'comment_post', 'wp_new_comment_notify_moderator', 10, 2 ); |
| 339 | 339 | add_action( 'comment_post', 'wp_new_comment_notify_postauthor' ); |
| 340 | 340 | add_action( 'after_password_reset', 'wp_password_change_notification' ); |
| | 341 | add_action( 'register_new_user', 'wp_send_new_user_notifications' ); |
| | 342 | add_action( 'edit_user_created_user', 'wp_send_new_user_notifications' ); |
| 341 | 343 | |
| 342 | 344 | /** |
| 343 | 345 | * Filters formerly mixed into wp-includes |
diff --git src/wp-includes/ms-default-filters.php src/wp-includes/ms-default-filters.php
index eab4fc4..08d752a 100644
|
|
|
add_action( 'wpmu_new_user', 'newuser_notify_siteadmin' ); |
| 27 | 27 | add_action( 'wpmu_activate_user', 'add_new_user_to_blog', 10, 3 ); |
| 28 | 28 | add_action( 'wpmu_activate_user', 'wpmu_welcome_user_notification', 10, 3 ); |
| 29 | 29 | add_action( 'after_signup_user', 'wpmu_signup_user_notification', 10, 4 ); |
| | 30 | add_action( 'network_site_new_created_user', 'wp_send_new_user_notifications' ); |
| | 31 | add_action( 'network_site_users_created_user', 'wp_send_new_user_notifications' ); |
| | 32 | add_action( 'network_user_new_created_user', 'wp_send_new_user_notifications' ); |
| 30 | 33 | add_filter( 'sanitize_user', 'strtolower' ); |
| 31 | 34 | |
| 32 | 35 | // Blogs |
diff --git src/wp-includes/user-functions.php src/wp-includes/user-functions.php
index 1feac3b..3640ea9 100644
|
|
|
function register_new_user( $user_login, $user_email ) { |
| 2012 | 2012 | |
| 2013 | 2013 | update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag. |
| 2014 | 2014 | |
| 2015 | | wp_new_user_notification( $user_id, 'both' ); |
| | 2015 | /** |
| | 2016 | * Fires after a new user registration has been recorded. |
| | 2017 | * |
| | 2018 | * @since 4.4.0 |
| | 2019 | * |
| | 2020 | * @param int $user_id ID of the newly registered user. |
| | 2021 | */ |
| | 2022 | do_action( 'register_new_user', $user_id ); |
| 2016 | 2023 | |
| 2017 | 2024 | return $user_id; |
| 2018 | 2025 | } |
| 2019 | 2026 | |
| 2020 | 2027 | /** |
| | 2028 | * Initiate email notifications related to the creation of new users. |
| | 2029 | * |
| | 2030 | * Notifications are sent both to the site admin and to the newly created user. |
| | 2031 | * |
| | 2032 | * @since 4.4.0 |
| | 2033 | * |
| | 2034 | * @param int $user_id ID of the newly created user. |
| | 2035 | */ |
| | 2036 | function wp_send_new_user_notifications( $user_id ) { |
| | 2037 | wp_new_user_notification( $user_id, 'both' ); |
| | 2038 | } |
| | 2039 | |
| | 2040 | /** |
| 2021 | 2041 | * Retrieve the current session token from the logged_in cookie. |
| 2022 | 2042 | * |
| 2023 | 2043 | * @since 4.0.0 |