[wp-hackers] [Patch] Propagating password change in an action

Ryan McCue lists at rotorised.com
Sat Oct 6 01:16:53 UTC 2012


Chloé Desoutter wrote:
> I've hit a difficulty when it comes to updating the password, as the
> profile_update hook does not allow me to get the new plaintext password.

Hi Chloé,

For bugs and feature requests, you should file a ticket on Trac:
http://core.trac.wordpress.org/

Once you've filed a ticket, you can attach a patch (such as the one
here) and it'll be considered for addition to core in the future. These
tickets also allow for better discussion than here on the mailing list.

> --- wordpress/wp-includes/user.php      2012-04-27 17:57:51.000000000 +0200
> +++ web/wp-includes/user.php    2012-10-04 17:36:12.382154680 +0200
> @@ -1427,6 +1427,8 @@ function wp_update_user($userdata) {
>         $current_user = wp_get_current_user();
>         if ( $current_user->ID == $ID ) {
>                 if ( isset($plaintext_pass) ) {
> +      // call password_updated to reflect that change elsewhere if needed
> +      do_action('password_updated', $ID, $plaintext_pass);
>                         wp_clear_auth_cookie();
>                         wp_set_auth_cookie($ID);
>                 }



More information about the wp-hackers mailing list