[wp-trac] [WordPress Trac] #41522: wp_set_password() doesn't trigger a changed password notification

WordPress Trac noreply at wordpress.org
Sun Jun 30 02:20:51 UTC 2024


#41522: wp_set_password() doesn't trigger a changed password notification
------------------------------------------+------------------------------
 Reporter:  henry.wright                  |       Owner:  (none)
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting Review
Component:  Users                         |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  dev-feedback has-patch close  |     Focuses:
------------------------------------------+------------------------------
Changes (by dd32):

 * keywords:  dev-feedback has-patch => dev-feedback has-patch close


Comment:

 I consider this to be the correct behaviour of the function.

 I think it's worth noting this comment in the functions description:

 > Please note: This function should be used sparingly and is really only
 meant for single-time application. Leveraging this improperly in a plugin
 or theme could result in an endless loop of password resets if precautions
 are not taken to ensure it does not execute on every page load.

 This function should be not be used where `wp_update_user( [ 'ID' =>
 $user_id, 'user_pass' => 'hunter1' ] );` would be more appropriate.

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


More information about the wp-trac mailing list