Call to Undefined Function get_currentuserinfo() Error in WordPress
In WordPress blog publishing system, there may be error been logged in Apache web server error_log file or been displayed on web pages which looks like the following line:
Fatal error: Call to undefined function: get_currentuserinfo() in /wordpress/wp-content/plugins/plugin.php
The undefined get_currentuserinfo function error normally happens in a poorly coded plugin. If the user deactivate the plug-in that causes the error, the issue will be fixed, resolved and go away. The error happens because $userdata or $user_id global variables become null, not defined or of empty value after the plugin is initiated, included, hooked and loaded.
The User ID and User Data (which User ID is part of) is globally-available var when in the WordPress admin pages. To resolve and fix the undefined get_currentuserinfo() function error, reset and scope the variable to global in the plugin before the beginning of the function which calling get_currenctuserinfo().
To set $userdata or $user_id vars to global scope, add in one of the following line into the beginning of the plugin PHP file:
$userdata = $GLOBALS['userdata'];
or,
global $userdata;
For user id, use “global $user_id;” instead.
Related Articles
- Call To Undefined Function: ctype_digit() in WordPress 2.5
- Call to Undefined Function: wp_constrain_dimensions() When Uploading Images or image_downsize() in Gallery/Media Library in WordPress 2.5
- PHP Fatal Error on Call to Add_Query_Var in Taxonomy.php After Upgrading to WordPress 2.5 RC2
- WordPress 2.5.1 Released for Download
- Disable WordPress 2.5 Flash Image/Video/Media Uploader with Plugin
- Fix WordPress 2.5 Image or Media Flash Uploader Not Working Issue in IE7
- How to SEO Optimize WordPress 2.5 Blog Web Page Title Without Optimal Title Plugin
- Make WordPress Blog More Secure Using Secret Key
- Media Buttons Disabler Plugin to Remove “Add Media” Icons in WordPress 2.5
- Workaround to Override WordPress Shortcode and Display the [] Brackets Tags









































