wp_get_current_user()
is actually just a wrapper for $current_user
and get_currentuserinfo()
, so you can use both. It’s important, though, to only call it on or after the init
hook. Calling it before will only return 0, as you’ve experienced.
wp_get_current_user()
is actually just a wrapper for $current_user
and get_currentuserinfo()
, so you can use both. It’s important, though, to only call it on or after the init
hook. Calling it before will only return 0, as you’ve experienced.