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.只要有可能。
Related Articles相关文章
- Fix Fatal Error Call to Function get_link() on Non-Object in WordPress 2.8 Dashboard with Technorati Incoming Links RSS修正致命错误召唤功能get_link在WordPress()非对象2.8与Technorati接踵而来的链接的RSS仪表板
- gmmktime Error in WordPress and MagpieRSS gmmktime误差在WordPress和magpierss的
- How to Customize, Modify or Change WordPress Database Connection Error Page如何自定义,修改或改变的WordPress数据库连接错误页
- WordPress MySQL SQL Query Error in WPDB Class WordPress的MySQL的SQL查询错误类的WPDB
- The Call to DllRegisterServer Failed with Error Code 0×80004005 on Windows Vista与错误代码召唤的DllRegisterServer失败0 × 80004005在Windows Vista
- Must Have WordPress Plugins必须有WordPress的插件
- Integrate WordPress including Comments with bbPress Forum using bbSync集成的WordPress包括评论与bbPress论坛使用bbSync
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin 3列放松WordPress主题的评论paged.php为分页评论WordPress插件
- Disable WordPress 2.3 Core and Plugins Update Check and Notification禁用的WordPress 2.3的核心和插件更新检查和通知
- Paginating or Split WordPress Post or Page with NextPage in WordPress Not Working Paginating或分裂的WordPress文章或页面与下一页在WordPress不工作










































October 28th, 2009 22:23 09年10月28日22时23分
[...] Above trick does not work in new WordPress version, try the fix undefined function get_currentuserinfo() fatal error guide [...]最重要的把戏[...]无法在新的WordPress版本,请尝试修复未定义函数get_currentuserinfo()致命的错误指导[...]