[wp-trac] [WordPress Trac] #44293: Discrepancy between documentation and implementation of wp_new_user_notification()

WordPress Trac noreply at wordpress.org
Sat Jun 2 15:48:16 UTC 2018


#44293: Discrepancy between documentation and implementation of
wp_new_user_notification()
----------------------------+------------------------------
 Reporter:  360zen          |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Users           |     Version:  4.3
 Severity:  minor           |  Resolution:
 Keywords:  good-first-bug  |     Focuses:
----------------------------+------------------------------

Comment (by 360zen):

 I'd love to make a contribution. As it would be my first, I may need a
 little guidance, but I will make sure to read the contribution guidelines
 and materials prior to bugging anyone with mundane questions.

 A couple points of clarification. The description of the function says
 "Email login credentials to a newly-registered user." However, as it is
 now, the default functionality, if no $notify parameter is set, is to
 email only the admin. This seems broken to me, as the point of the
 function is to send a new user their credentials (or in the newer versions
 of WP, their password reset link).

 I would propose that, by default, the function should send both emails
 when called with only the $user_id parameter. So
 `wp_new_user_notification($user_id)` would send both. This could be
 achieved by changing the default of the $notify parameter from `''` to
 `'both'` or modifying the logic used to return early. However, this could
 potentially cause some unexpected emails to go out to users if anyone is
 using the short version of the call (
 `wp_new_user_notification($user_id)`) expecting to send only admin emails.

 Do you have any thoughts about how much trouble that would cause? IMO, it
 seems worth it to have the function behave intuitively, but I understand
 the need for caution with changes like this.

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


More information about the wp-trac mailing list