get_currentuserinfo does not work!!
-
Hello,
I have a plugin that creates a new menu in the admin_menu, for this I use the file “menu-panels.php” which is the main file for the plugin. Where I do the add_actions(__,__) necesary.From there, I go to a new page (add-panel.php) where I have created a form with a submit buttom. This is because I need some operations to obtain the power of a solar panel produces. So, when I press the submit I go to calculate-pw.php, and here I need to get information about the user because I am going to introduce some data in the database.
But when I call the function get_currentuserinfo() I getFatal error: Call to undefined function get_gurrentuserinfo()
I only have one plugin, this one, so there cannot be incompatibilities.
I clean the variable doing a:
global $current_user;
get_currentuserinfo();
PLEASE can somebody help!?I know that if I call the function get_currentuserinfo() from the main page of the plugin “menu-panels.php” in this way:
add_action('init','obtain_user'); function obtain_user(){ global $current_user; get_currentuserinfo(); }
It works!
but I do not need that information here, I need the information only when the user wants to create a new panel.
THANK YOU!
- The topic ‘get_currentuserinfo does not work!!’ is closed to new replies.