[wp-hackers] get_users() magic methods revisited

Mike Walsh mpwalsh8 at gmail.com
Mon Feb 24 18:16:21 UTC 2014


That is my suspicion as well.  I don't have an answer yet as to what
version of PHP and what version of WordPress the person reporting the
problem is running on.  According to the Codex, the WP_Users magic methods
were added in 3.3 so it is hard for me to believe this user is using a
version of WordPress that old.




On Mon, Feb 24, 2014 at 1:13 PM, Nikola Nikolov <nikolov.tmw at gmail.com>wrote:

> Which version of WP are they using? I think that before the introduction of
> the WP_User object, objects returned from get_users() were just normal
> StdClass objects which therefore don't have magic methods and would return
> null(I believe) when you try to access an unset property(and raise a
> warning depending on the error levels) which in turn when converted to
> string becomes an empty string.
>
>
> On Mon, Feb 24, 2014 at 7:06 PM, Mike Walsh <mpwalsh8 at gmail.com> wrote:
>
> > A while ago I posted a question which resulted in a suggestion to rely on
> > the "magic methods" of get_users() to  reference the first name and last
> > name fields stored as user meta data.
> >
> > http://lists.automattic.com/pipermail/wp-hackers/2012-June/043340.html
> >
> > I am revisiting this because I've had a report from one user of a plugin
> > which makes uses of this that their first name and last name fields are
> > always empty.  Does anyone know of a reason why in some instances this
> data
> > wouldn't be populated?
> >
> > --
> > Mike Walsh - mpwalsh8 at gmail.com
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Mike Walsh - mpwalsh8 at gmail.com


More information about the wp-hackers mailing list