retrieving user_ID in a plugin
-
I’ve gone over every related post on here as well on the wp-hackers mailing list and need some advice, please.
I am trying to populate the $user_ID variable for inclusion inside an http_get request that currently exists inside a function. Knowing that I cannot use get_currentuserinfo() because pluggable.php isnt loaded, I tested seeing what would happen if tied that fucntion to a hook, in this case, init. As i expected, get_currentuserinfo() works, and the variable is populated, but because Ive tied the function into init, its submitting data the minute the plugin is loaded, without the http_get even being called.
I’ve read a cpl references to setup_userdata() on here, seen one example, which doesnt work for me in this case.
So here is my question.
How can I populate the $user_ID variable without tying it to a hook?
- The topic ‘retrieving user_ID in a plugin’ is closed to new replies.