#61541 closed enhancement (fixed)
wp_set_password hook lacks previous context
Reported by: | dd32 | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | 6.2 |
Component: | Users | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
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 $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 );
Change History (4)
This ticket was mentioned in PR #6948 on WordPress/wordpress-develop by @dd32.
2 months ago
#1
- Keywords has-patch has-unit-tests added
#2
@
2 months ago
- Milestone changed from Awaiting Review to 6.7
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
@SergeyBiryukov commented on PR #6948:
2 months ago
#4
Thanks for the PR! Merged in r58653.
Note: See
TracTickets for help on using
tickets.
Similar to other user hooks that pass the previous user state, this adds the previous user state to the wp_set_password hook.
This passes the full user details, rather than only the changed details, for consistency with other hooks.
Trac ticket: https://core.trac.wordpress.org/ticket/61541