can’t get $user_ID in plugin
-
I’m writing a plugin that creates a new sub menu in users. it’s called with …wp-admin/profile.php?page=headshot I everything except one tiny thing that is confusing the heck out of me. I can’t get the current user id. I need it so I can name a file with that number.
For testing the plugin, I have some extremely simple code as follows:
echo $user_ID;
It return nothing. So I thought it might need:
global $user_ID;
echo $user_ID;I’m new to wordpress, but from what I’ve read, $user_ID is a global variable. Am I missing something really simple here? Or is there some reason that variable is not available through profile.php (which makes no sense to me).
Help is appreciated.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘can’t get $user_ID in plugin’ is closed to new replies.