[wp-trac] [WordPress Trac] #40497: wp_insert_user requires user_login when ID is given

WordPress Trac noreply at wordpress.org
Mon Apr 24 08:13:41 UTC 2017


#40497: wp_insert_user requires user_login when ID is given
-------------------------------------+------------------------------
 Reporter:  johnprestonsoapmedia     |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Users                    |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  needs-patch 2nd-opinion  |     Focuses:
-------------------------------------+------------------------------
Changes (by johnprestonsoapmedia):

 * keywords:  needs-patch reporter-feedback 2nd-opinion => needs-patch 2nd-
     opinion


Comment:

 Replying to [comment:1 johnbillion]:
 > Thanks for the report, @johnprestonsoapmedia, and welcome to WordPress
 Trac.
 >
 > This does appear to be valid, but the same issue is not present when you
 call the `wp_update_user()` function which you should ideally use when
 updating a user. Is there a particular reason in this scenario why you're
 not using `wp_update_user()`?
 >
 > Regardless, it looks on the surface like this should be fixed.

 Hi @johnbillion. The documentation for `wp_update_user`
 [https://codex.wordpress.org/Function_Reference/wp_update_user] indicates
 that it should be used when updating a user only and when sending an email
 is desired, whereas `wp_insert_user`
 [https://codex.wordpress.org/Function_Reference/wp_insert_user] should be
 used when creating or updating and when an email should not be sent.

 In my use case I wanted to ensure no email was sent, so I used
 `wp_insert_user`.

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


More information about the wp-trac mailing list