Make WordPress Core

Ticket #45359: 2187.diff

File 2187.diff, 1.7 KB (added by Mte90, 2 years ago)

adding the patch from GH to track on My patches on Trac

  • src/wp-admin/options-general.php

    diff --git a/src/wp-admin/options-general.php b/src/wp-admin/options-general.php
    index dfc396f8d28..dbff5f1d709 100644
    a b  
    136136</td>
    137137</tr>
    138138
     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
    139147<?php if ( ! is_multisite() ) { ?>
    140148
    141149<tr>
  • src/wp-includes/user.php

    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 ) { 
    29332933        wp_set_password( $new_pass, $user->ID );
    29342934        update_user_meta( $user->ID, 'default_password_nag', false );
    29352935
    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        }
    29452947}
    29462948
    29472949/**