[wp-hackers] getting current user info

Lloyd Budd lloydomattic at gmail.com
Thu Nov 8 19:03:42 GMT 2007


On 11/8/07, Travis Snoozy <ai2097 at users.sourceforge.net> wrote:
> > http://codex.wordpress.org/Function_Reference/get_currentuserinfo
>
> get_currentuserinfo is only needed if you're doing stuff really,
> really early. When wp() is called, get_currentuserinfo is called
> automatically; any filters/actions that are used after the wp action
> just need to use the globals (it's been that way since 2.0). There are
> only a tiny handful of actions that you can hook that *won't* have the
> global data already set (most notably, plugins_loaded and init).

Although particularly unlikely to change...
Using functions (local variables) is a usually great way to reduce
possibly maintenance.

Cheers,
Lloyd


More information about the wp-hackers mailing list