[wp-trac] [WordPress Trac] #54984: wp_update_user doesn't work properly with current user instance

WordPress Trac noreply at wordpress.org
Sat Jan 29 15:49:45 UTC 2022


#54984: wp_update_user doesn't work properly with current user instance
--------------------------+---------------------
 Reporter:  oztaser       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.0
Component:  Users         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+---------------------

Comment (by ravipatel):

 wp_update_user() has a condition to convert a password in hash.


 {{{
 if ( ! empty( $userdata['user_pass'] ) && $userdata['user_pass'] !==
 $user_obj->user_pass ) {
                 // If password is changing, hash it now.
                 $plaintext_pass        = $userdata['user_pass'];
                 $userdata['user_pass'] = wp_hash_password(
 $userdata['user_pass'] );

                 /**
                  * Filters whether to send the password change email.
                  *
                  * @since 4.3.0
                  *
                  * @see wp_insert_user() For `$user` and `$userdata`
 fields.
                  *
                  * @param bool  $send     Whether to send the email.
                  * @param array $user     The original user array.
                  * @param array $userdata The updated user array.
                  */
                 $send_password_change_email = apply_filters(
 'send_password_change_email', true, $user, $userdata );
         }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54984#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list