[wp-trac] [WordPress Trac] #45745: wp_new_user_notification should use get_password_reset_key

WordPress Trac noreply at wordpress.org
Sun Jan 6 00:54:40 UTC 2019


#45745: wp_new_user_notification should use get_password_reset_key
--------------------------------------+------------------------------
 Reporter:  spacedmonkey              |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Users                     |     Version:  4.4
 Severity:  normal                    |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:
--------------------------------------+------------------------------
Changes (by spacedmonkey):

 * keywords:  good-first-bug needs-patch => good-first-bug has-patch


Comment:

 Thanks for @mrasharirfan the first patch.

 The only thing I would change, is add a little error handling.
 `get_password_reset_key` can return a `WP_Error`. So there should be the
 following check added.

 {{{#!php
 if ( is_wp_error( $key ) ) {
     return;
 }
 }}}

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


More information about the wp-trac mailing list