diff --git a/src/wp-admin/options-general.php b/src/wp-admin/options-general.php
index dfc396f8d28..dbff5f1d709 100644
a
|
b
|
|
136 | 136 | </td> |
137 | 137 | </tr> |
138 | 138 | |
| 139 | <tr> |
| 140 | <th scope="row"><?php _e( 'Disable User Password Change Notification' ); ?></th> |
| 141 | <td> <fieldset><legend class="screen-reader-text"><span><?php _e( 'Disable User Password Change Notification' ); ?></span></legend><label for="disable_psw_change_email"> |
| 142 | <input name="disable_psw_change_email" type="checkbox" id="disable_psw_change_email" value="1" <?php checked( '1', get_option( 'disable_psw_change_email' ) ); ?> /> |
| 143 | <?php _e( 'Otherwise the admin will receive an email notification of any user\'s password changed' ); ?></label> |
| 144 | </fieldset></td> |
| 145 | </tr> |
| 146 | |
139 | 147 | <?php if ( ! is_multisite() ) { ?> |
140 | 148 | |
141 | 149 | <tr> |
diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
index 018c960c031..b7e361c2508 100644
a
|
b
|
function reset_password( $user, $new_pass ) { |
2933 | 2933 | wp_set_password( $new_pass, $user->ID ); |
2934 | 2934 | update_user_meta( $user->ID, 'default_password_nag', false ); |
2935 | 2935 | |
2936 | | /** |
2937 | | * Fires after the user's password is reset. |
2938 | | * |
2939 | | * @since 4.4.0 |
2940 | | * |
2941 | | * @param WP_User $user The user. |
2942 | | * @param string $new_pass New user password. |
2943 | | */ |
2944 | | do_action( 'after_password_reset', $user, $new_pass ); |
| 2936 | if ( ! get_option( 'disable_psw_change_email' ) ) { |
| 2937 | /** |
| 2938 | * Fires after the user's password is reset. |
| 2939 | * |
| 2940 | * @since 4.4.0 |
| 2941 | * |
| 2942 | * @param WP_User $user The user. |
| 2943 | * @param string $new_pass New user password. |
| 2944 | */ |
| 2945 | do_action( 'after_password_reset', $user, $new_pass ); |
| 2946 | } |
2945 | 2947 | } |
2946 | 2948 | |
2947 | 2949 | /** |