Make WordPress Core


Ignore:
Timestamp:
07/03/2024 04:08:55 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Users: Pass the previous state of the user as context to the wp_set_password hook.

Follow-up to [55056], [55250].

Props dd32.
Fixes #61541.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pluggable.php

    r57990 r58653  
    27692769                global $wpdb;
    27702770
     2771                $old_user_data = get_userdata( $user_id );
     2772
    27712773                $hash = wp_hash_password( $password );
    27722774                $wpdb->update(
    … …  
    27852787                 *
    27862788                 * @since 6.2.0
    2787                  *
    2788                  * @param string $password The plaintext password just set.
    2789                  * @param int    $user_id  The ID of the user whose password was just set.
    2790                  */
    2791                 do_action( 'wp_set_password', $password, $user_id );
     2789                 * @since 6.7.0 The `$old_user_data` parameter was added.
     2790                 *
     2791                 * @param string  $password      The plaintext password just set.
     2792                 * @param int     $user_id       The ID of the user whose password was just set.
     2793                 * @param WP_User $old_user_data Object containing user's data prior to update.
     2794                 */
     2795                do_action( 'wp_set_password', $password, $user_id, $old_user_data );
    27922796        }
    27932797endif;
Note: See TracChangeset for help on using the changeset viewer.