WordPress Call To Undefined Function get_currentuserinfo() PHP Error
After uploading, installing and activation some plugins for WordPress blog publishing system, the plug-ins may cause the following PHP error message, logged by 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
To make matter worse, these plugins are working fine previously, and suddenly broken down or throwing out the error. The cause of the issue is due to the reason that get_currentuserinfo() function is defined within pluggable.php of WordPress core. The problem is that pluggable.php is only been loaded after all the plugins has been loaded. It means that get_currentuserinfo() is not yet available when plugins are triggering and needing the function.
To resolve the fix the “call to undefined get_currentuser() function error, just call pluggable.php prior to calling function the requires it. A little PHP programming skill is required, but for novice, it’s not hard to re-code the plugin source code to get the error solved.
Search for the get_currentuser in the PHP file which the error indicates having problem. Then copy and paste the following lines before (on top of) the line of get_current_user().
require(ABSPATH . WPINC . ‘/pluggable.php’);
Tip: It’s also possible substitute require with requice_once so that pluggable.php is unloaded once the get_currentuser() function is executed.
For example,
require (ABSPATH . WPINC . '/pluggable.php');
get_currentuserinfo();
Related Articles
- Fix Call to Undefined Function read_global() Error in Google AdSense Mobile Content PHP Ad Code
- Fix Fatal Error Call to Function get_link() on Non-Object in WordPress 2.8 Dashboard with Technorati Incoming Links RSS
- gmmktime Error in WordPress and MagpieRSS
- How to Customize, Modify or Change WordPress Database Connection Error Page
- WordPress MySQL SQL Query Error in WPDB Class
- Must Have WordPress Plugins
- The Call to DllRegisterServer Failed with Error Code 0×80004005 on Windows Vista
- Integrate WordPress including Comments with bbPress Forum using bbSync
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin
- Disable WordPress 2.3 Core and Plugins Update Check and Notification










































October 28th, 2009 22:23
[...] Above trick does not work in new WordPress version, try the fix undefined function get_currentuserinfo() fatal error guide [...]