[wp-trac] [WordPress Trac] #61541: wp_set_password hook lacks previous context

WordPress Trac noreply at wordpress.org
Sun Jun 30 02:27:00 UTC 2024


#61541: wp_set_password hook lacks previous context
-------------------------+-----------------------------
 Reporter:  dd32         |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Users        |    Version:  6.2
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 In #57436 a hook was added to wp_set_password, but unlike the other user-
 related hooks, this hook doesn't pass the previous state of the user as
 context to the hook.

 Adding additional context, either as the fields that have been modified,
 or as a full WP_User would be appreciated for logging and authentication
 plugins.
 {{{#!php
 <?php
 $old_user_data = array( 'user_pass' => ...., 'user_activation_key' => ...
 );
 or
 $old_user_data = get_user_by( ... )

 // perform user update; $wpdb->update()

 do_action( 'wp_set_password', $password, $user_id, $old_user_data );
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61541>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list