Making WordPress.org

Changeset 14641


Ignore:
Timestamp:
01/23/2026 06:35:40 AM (10 months ago)
Author:
dd32
Message:

Add a filter to disable logging of password changes, such as when the password is forcibly reset by us.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/wporg-sso/wp-plugin.php

    r14515 r14641  
    992992                 */
    993993                public function record_last_password_change( $user_id, $old_data, $new_data ) {
    994                         if ( $old_data->user_pass !== $new_data['user_pass'] ) {
     994                        if (
     995                                $old_data->user_pass !== $new_data['user_pass'] &&
     996                                apply_filters( 'wporg_record_last_password_change', true, $user_id )
     997                        ) {
    995998                                update_user_meta( $user_id, 'last_password_change', gmdate( 'Y-m-d H:i:s' ) );
    996999                        }
    … …  
    10061009                        $old_user_pass = is_object( $old_user_data ) ? $old_user_data->user_pass : ( is_array( $old_user_data ) ? $old_user_data['user_pass'] : '' );
    10071010
    1008                         if ( $old_user_pass !== $user->user_pass ) {
     1011                        if (
     1012                                $old_user_pass !== $user->user_pass &&
     1013                                apply_filters( 'wporg_record_last_password_change', true, $user_id )
     1014                        ) {
    10091015                                update_user_meta( $user_id, 'last_password_change', gmdate( 'Y-m-d H:i:s' ) );
    10101016                        }
Note: See TracChangeset for help on using the changeset viewer.