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.



Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to Tip and Trick Comments RSS feed or register to receive new comments in daily email digest.
Custom Search

Incoming Search Terms for the Article

Call to undefined function get_currentuserinfo() - get_currentuserinfo - wordpress get_currentuserinfo - get_currentuserinfo() - get_currentuserinfo wordpress - Fatal error: Call to undefined function get_currentuserinfo() - Fatal error: Call to undefined function get_currentuserinfo() in - Call to undefined function get_currentuserinfo - Call to undefined function: get_currentuserinfo() - wordpress 2.5 get_currentuserinfo() - get_currentuserinfo() wordpress - get_currentuserinfo(); - undefined function get_currentuserinfo - demonoid - wordpress Call to undefined function get_currentuserinfo() - Call to undefined function wordpress - wordpress $get_currentuserinfo() undefined function - wordpress get_currentuserinfo(); - Call to undefined function: get_currentuserinfo() - call to undefined function get_currentuserinfo - get_currentuserinfo include file - error - get_currentuserinfo is empty - "Call to undefined function get_currentuserinfo()" - cache:UF8qtUyl2mYJ:en.redtram.com/go/107212849/ Call to undefined function get_currentuserinfo() - wordpress get_currentuserinfo() error - wordpress 2.5 get_currentuserinfo - wordpress call to undefined function - wordpress get_currentuserinfo() need include ? - wordpress call function - get_currentuserinfo(); - wordpress which file get_currentuserinfo - get_currentuserinfo() - Call to undefined function: get_currentuserinfo() i - wordpress get_currentuserinfo() inside plugin - wordpress "Fatal error: Call to undefined function get_currentuserinfo()" - wordpress Call to undefined function get_currentuserinfo( - get_currentuserinfo undefined wordpress - wordpress call function in plugin - Call to undefined function get_currentuserinfo - "Call to undefined function get_currentuserinfo" - call to undefined function get_currentuserinfo(); - Fatal error: Call to undefined function get_currentuserinfo() - get_currentuserinfo() what file is that function in - how to call get_currentuserinfo() from different page - ie7 undefined scope error - Call to undefined function get_currentuserinfo( pugin wordpress - "get_currentuserinfo" - Call to undefined function get_currentuserinfo() - get_currentuserinfo include -