WordPress Call To Undefined Function get_currentuserinfo() PHP Error WordPress的呼叫未定义功能get_currentuserinfo()PHP的错误

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:上载后,安装和激活为WordPress博客发布系统的一些插件,该插件可能会导致以下PHP的错误信息,由Apache网站error_log文件服务器记录或网页上已经像下面这行看起来显示:

Fatal error: Call to undefined function: get_currentuserinfo() in /wordpress/wp-content/plugins/plugin.php致命错误:调用未定义的函数:get_currentuserinfo()在/ WordPress的/可湿性粉剂内容/插件/ 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.该问题的原因是由于该get_currentuserinfo()函数内的WordPress的核心pluggable.php定义的原因。 The problem is that pluggable.php is only been loaded after all the plugins has been loaded.问题是,只有经过所有的插件加载的pluggable.php已加载。 It means that get_currentuserinfo() is not yet available when plugins are triggering and needing the function.这意味着get_currentuserinfo()目前尚未上市时,插件触发和需要的功能。

To resolve the fix the “call to undefined get_currentuser() function error, just call pluggable.php prior to calling function the requires it.要解决此修复程序的“电话未定义get_currentuser()函数的错误,只是调用pluggable.php调用函数之前,它的要求。 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.一个小PHP编程技巧是必需的,但对于新手来说,这个并不难重新编码插件源代码,以获取错误解决。

Search for the get_currentuser in the PHP file which the error indicates having problem.搜索在PHP文件,该文件的错误表示有问题get_currentuser。 Then copy and paste the following lines before (on top of) the line of get_current_user().然后复制并粘贴以下行前(上面的)的get_current_user线()。

require(ABSPATH . WPINC . '/pluggable.php'); 要求(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.提示:也有可能取代需要与requice_once使pluggable.php是卸载后get_currentuser()函数执行。

For example,例如,

require (ABSPATH . WPINC . '/pluggable.php');
get_currentuserinfo();

IMPORTANT : The page is machine translated and provided "as is" without warranty. 重要说明 :该网页是机器翻译,并提供“按原样”不做。 Machine translation may be difficult to understand.机器翻译可能很难理解。 Please refer to请参阅 original English article英文原版的文章 whenever possible.只要有可能。


One Response to “WordPress Call To Undefined Function get_currentuserinfo() PHP Error”一对“WordPress的呼叫未定义功能get_currentuserinfo()PHP的错误”

  1. Call to Undefined Function get_currentuserinfo() Error in WordPress » Tip and Trick调用未定义函数get_currentuserinfo在WordPress »提示和计谋()错误
    October 28th, 2009 22:23 09年10月28日22时23分
    1 1

    [...] Above trick does not work in new WordPress version, try the fix undefined function get_currentuserinfo() fatal error guide [...]最重要的把戏[...]无法在新的WordPress版本,请尝试修复未定义函数get_currentuserinfo()致命的错误指导[...]

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> 您可以使用这些标记:<a title="">的title=""> <acronym title="">的首字母的<b> <blockquote cite=""> <cite>的<code>“删除日期=“”“<em>的<i> <q cite=""> <strike>的<strong>

Subscribe to comments feature has been disabled. 订阅功能已被禁用的意见。 To receive notification of latest comments posted, subscribe to 收到最新意见的通知张贴,订阅 My Digital Life Comments RSS feed 我的数字生活评论RSS饲料 or register to receive 注册以接收 new comments in daily email digest. 在每日电子邮件摘要中新意见。
Custom Search

New Articles新文章

Incoming Search Terms for the Article接踵而来的查寻期限为文章