Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/wp-admin/options-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@
</td>
</tr>

<tr>
<th scope="row"><?php _e( 'Disable User Password Change Notification' ); ?></th>
<td> <fieldset><legend class="screen-reader-text"><span><?php _e( 'Disable User Password Change Notification' ); ?></span></legend><label for="disable_psw_change_email">
<input name="disable_psw_change_email" type="checkbox" id="disable_psw_change_email" value="1" <?php checked( '1', get_option( 'disable_psw_change_email' ) ); ?> />
<?php _e( 'Otherwise the admin will receive an email notification of any user\'s password changed' ); ?></label>
</fieldset></td>
</tr>

<?php if ( ! is_multisite() ) { ?>

<tr>
Expand Down
20 changes: 11 additions & 9 deletions src/wp-includes/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -2933,15 +2933,17 @@ function reset_password( $user, $new_pass ) {
wp_set_password( $new_pass, $user->ID );
update_user_meta( $user->ID, 'default_password_nag', false );

/**
* Fires after the user's password is reset.
*
* @since 4.4.0
*
* @param WP_User $user The user.
* @param string $new_pass New user password.
*/
do_action( 'after_password_reset', $user, $new_pass );
if ( ! get_option( 'disable_psw_change_email' ) ) {
/**
* Fires after the user's password is reset.
*
* @since 4.4.0
*
* @param WP_User $user The user.
* @param string $new_pass New user password.
*/
do_action( 'after_password_reset', $user, $new_pass );
}
}

/**
Expand Down