Fatal error: Call to undefined function wp_get_current_user
-
Hey all,
Got an odd error going on at the moment –
I have a plugin that uses the following code –
if(current_user_can('manage_options')){ add_action('admin_menu', 'add_dd_options_menu'); add_action('admin_head', 'dd_options_header'); }
But this plugin generates this error –
Fatal error: Call to undefined function wp_get_current_user() in C:\wamp\www\website\test\wp-includes\capabilities.php on line 1059
Changing it to the below so that I am not checking capabilities works fine –
//if(current_user_can('manage_options')){ add_action('admin_menu', 'add_dd_options_menu'); add_action('admin_head', 'dd_options_header'); //}
But the strangest thing is that this statement in a different file works fine, even when checking capabilities –
if(current_user_can('manage_options')){ require_once('dd_includes/dashboard_widgets.php'); add_action('admin_menu', 'remove_rubbish_dashboard_boxes'); }
Does anybody know if I am missing anything, or if i have made a very silly mistake with the code?
Any help apprciated.
Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Fatal error: Call to undefined function wp_get_current_user’ is closed to new replies.