[wp-trac] [WordPress Trac] #18551: get_userdata returning full user object, not data like it used to
WordPress Trac
wp-trac at lists.automattic.com
Sat Sep 3 14:53:51 UTC 2011
#18551: get_userdata returning full user object, not data like it used to
-------------------------------+------------------
Reporter: anmari | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.3
Component: Users | Version: 3.3
Severity: major | Resolution:
Keywords: reporter-feedback |
-------------------------------+------------------
Comment (by dd32):
> > get_userdata used to return the data part of the user object in 3.2.1
> That is incorrect. In 3.2 and before, get_userdata() returned all the
user fields mixed with user metadata
Just to clarify that, Yes, The return value has changed, a WP_User object
is returned instead of a dumb object. However, through the usage of magic
methods, data fields (such as the meta key rich_editing),
{{{get_userdata(1)->rich_editing}}} will map to
{{{get_userdata(1)->data->rich_editing}}}, even though in a var_dump() or
similar will not show these extra fields.. So you shouldn't need to use
the code in comment:4 as it should just work (Side note: The code in
comment:4 will actually break, in the sense that it will not include the
meta fields, it'll only contain the user row data)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18551#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list