[wp-trac] [WordPress Trac] #63770: WordPress wp_insert_user() throws warning when password is not provided

WordPress Trac noreply at wordpress.org
Tue Aug 19 23:29:28 UTC 2025


#63770: WordPress wp_insert_user() throws warning when password is not provided
-------------------------------------+-------------------------------------
 Reporter:  sheldorofazeroth         |       Owner:  sheldorofazeroth
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:  6.9
Component:  Users                    |     Version:
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-test-info has-patch  |     Focuses:  coding-standards, php-
  commit                             |  compatibility
-------------------------------------+-------------------------------------
Changes (by peterwilsoncc):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60650" 60650]:
 {{{
 #!CommitTicketReference repository="" revision="60650"
 Users: Throw specific warning when `wp_insert_user()` called without
 `user_pass`.

 Modifies `wp_insert_user()` to throw the warning `The user_pass field is
 required when creating a new user. The user will need to reset their
 password before logging in.` when called without the `user_pass` argument
 defined.

 This avoids a mix of warnings being thrown depending on the version of PHP
 the system is running on, anywhere between zero and three.

 To retain backward compatibility the user is created with an empty
 password. As WordPress does not accept an empty password during
 authentication, this will require the newly created user complete the
 password reset process.

 Props dd32, hbhalodia, iamadisingh, mindctrl, rollybueno,
 sheldorofazeroth, shilpaashokan94
 Fixes #63770.
 }}}

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


More information about the wp-trac mailing list