[wp-trac] [WordPress Trac] #25745: Update user with wp_insert_user reset first and last name

WordPress Trac noreply at wordpress.org
Mon Oct 28 19:59:56 UTC 2013


#25745: Update user with wp_insert_user reset first and last name
--------------------------+----------------------
 Reporter:  sudoku1       |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:  3.6.1
 Severity:  normal        |  Resolution:  invalid
 Keywords:  dev-feedback  |
--------------------------+----------------------
Changes (by DrewAPicture):

 * keywords:  dev-feedback reporter-feedback => dev-feedback
 * status:  new => closed
 * resolution:   => invalid
 * severity:  major => normal
 * milestone:  Awaiting Review =>


Comment:

 Replying to [comment:8 sudoku1]:
 > Yes but it's another issue.
 > You get the point I'm trying to explain with the code sample? Its clear
 enough?
 > Cheers

 The first and last names getting reset is intended behavior for
 `wp_insert_user()` if don't pass them in.

 The issue is that you should really be using `wp_update_user()` here
 instead. Otherwise, you need to make sure to pass '''all''' userdata
 fields when you're attempting to update a user. `wp_update_user()` does
 this for you.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25745#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list