[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
Sun Sep 4 08:26:56 UTC 2011


#18551: get_userdata returning full user object, not data  like it used to
-------------------------------+----------------------
 Reporter:  anmari             |       Owner:
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:  3.3
Component:  Users              |     Version:  3.3
 Severity:  major              |  Resolution:  invalid
 Keywords:  reporter-feedback  |
-------------------------------+----------------------
Changes (by anmari):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Hi all,
 Thank you for taking the time to explain.

 On $user_info->user_login I was getting

 {{{
 Notice: Trying to get property of non-object in..
 }}}

 and then when I var_dumped and saw what I saw, I thought that was the
 reason.  However on digging deeper I realised the call was in a loop
 however I was only getting the notice once . IE there was a data problem
 which resulted in the code having a userid for a user that was not there!

 So anyway I learnt something - one cannot always trust a var_dump! (and to
 add more checks in the code!)

 I have made a note in the Codex in case anyone else manages to confuse
 themselves.
 http://codex.wordpress.org/Function_Reference/get_userdata#Notes

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


More information about the wp-trac mailing list