[wp-hackers] getting current user info

Andy Staines andy at yellowswordfish.com
Thu Nov 8 17:46:26 GMT 2007


I'd use this:

	global $user_login, $user_ID, $user_identity, $user_email;

	get_currentuserinfo();

the function populates the globals for you.

Andy

On 05:37  PM |  Thu 8 Nov 07, at 05:37  PM |  8 Nov 07, Mindshare  
Studios wrote:

> Hi
>
> I'm trying to get info on the currently logged in user for a plugin  
> I'm
> working on. This code isn't working:
>
> $current_user = setup_userdata($current_user->ID);
> echo $current_user->$user_email;
>
> I could be barking up the wrong tree entirely. Any suggestions?
>
> Thanks,
>
> Damian Taggart
> Mindshare Studios, Inc.
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list