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

WordPress Trac noreply at wordpress.org
Wed May 3 04:27:13 UTC 2017


#40497: wp_insert_user requires user_login when ID is given
--------------------------------------+------------------
 Reporter:  johnprestonsoapmedia      |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  4.8
Component:  Users                     |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------

Comment (by dd32):

 Replying to [comment:3 johnprestonsoapmedia]:
 > 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.

 Just noting that in this case the documentation looks incorrect - and it
 should be noted that the codex is a wiki and community powered, it's not
 "official" documentation. The Developer documentation for
 [https://developer.wordpress.org/reference/functions/wp_insert_user/
 wp_insert_user()] does make reference to the fact that passing an `ID`
 will cause it to be updated, but the intentional usage is not to bypass
 sending an email, that's just a side effect (that should probably be
 fixed).

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


More information about the wp-trac mailing list