[wp-trac] [WordPress Trac] #19656: wp_update_user() not compatible with cast-to-array WP_User objects

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 23 20:19:17 UTC 2011


#19656: wp_update_user() not compatible with cast-to-array WP_User objects
--------------------------+------------------------------
 Reporter:  boonebgorges  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Users         |     Version:  3.3
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by boonebgorges):

 > I don't think it's worth it, when all you need to do is replace
 get_object_vars( $user ) with get_object_vars( $user->data ).

 Yes, that's what I've done in BuddyPress
 http://buddypress.trac.wordpress.org/changeset/5588. I do think it's
 important to do something, though, in part because wp_update_user() still
 returns $user_id even when you pass it malformed data, which makes it hard
 to tell when something like a password update has failed.

 > We could make wp_update_user() accept WP_User instances, though.

 Yeah, that amounts to about the same thing, and it'd be great. (Was a bit
 more work than 19656.patch, which is why I didn't do it :) ).

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


More information about the wp-trac mailing list