Call to Undefined Function get_currentuserinfo() Error in WordPress调用未定义函数get_currentuserinfo()错误在WordPress
In WordPress在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:系统,可能有错误被记录在Apache Web服务器error_log文件或网页上已经像下面这行看起来显示:
Fatal error: Call to undefined function: get_currentuserinfo() in /wordpress/wp-content/plugins/plugin.php致命错误:调用未定义的函数:get_currentuserinfo()在/ WordPress的/可湿性粉剂内容/插件/ plugin.php
The undefined get_currentuserinfo function error normally happens in a poorly coded plugin.未定义get_currentuserinfo函数的错误通常发生在编码插件欠佳。 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.错误发生,因为用户数据或$ $ user_ID的全局变量成为空,没有定义或空值后,启动插件,包括上钩,加载。
The User ID and User Data (which User ID is part of) is globally-available var when in the WordPress admin pages.用户ID和用户数据(即用户名的一部分),是全球可用的无功时,在WordPress管理页面。 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().要解决和确定未定义get_currentuserinfo()函数错误,复位和范围在插件变量全球前函数调用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:要设置用户数据或$ $ user_ID的瓦尔全球范围内,在下列行一个添加到插件的PHP文件的开头:
$userdata = $GLOBALS['userdata']; $用户数据= $全局['用户数据'];
or,或,
global $userdata;全球$用户数据;
For user id, use “global $user_id;” instead.对于用户名,请使用“全球$ user_ID的;”代替。
Update: Above trick does not work in new WordPress version, try the更新:以上伎俩无法在新的WordPress版本,请尝试 fix undefined function get_currentuserinfo() fatal error修复未定义函数get_currentuserinfo()致命错误 guide instead.指南,而不是。
IMPORTANT : You're reading a machine translated page which is provided "as is" without warranty. 重要说明 :您正在阅读的翻译网页,其中提供“按原样”不附带任何一台机器。 Unlike human translation, machine translation does not understand the grammar, semantics, syntax, idioms of natural language, thus often produce inaccurate and low quality text which is misleading and incomprehensible.不像人类翻译,机器翻译不明白的语法,语义,句法,成语自然语言,因此,往往产生不准确的和低质量文本,是误导和令人费解。 Thus, please refer to因此,请参阅 original English article英文原版的文章 when in doubt.当怀疑。
Related Articles相关文章
- Call To Undefined Function: ctype_digit() in WordPress 2.5呼叫未定义功能:ctype_digit()在WordPress 2.5
- Call to Undefined Function: wp_constrain_dimensions() When Uploading Images or image_downsize() in Gallery/Media Library in WordPress 2.5未定义的函数调用:wp_constrain_dimensions()当上传图片或image_downsize()在多媒体/媒体库在WordPress 2.5
- PHP Fatal Error on Call to Add_Query_Var in Taxonomy.php After Upgrading to WordPress 2.5 RC2 PHP的致命错误就立刻上Taxonomy.php升级后的Add_Query_Var向WordPress 2.5 RC2测试版
- WordPress 2.5.1 Released for Download WordPress的2.5.1发布下载
- Fix WordPress 2.5 Image or Media Flash Uploader Not Working Issue in IE7修正的WordPress 2.5图像或媒体闪光上传不工作在IE7问题
- Disable WordPress 2.5 Flash Image/Video/Media Uploader with Plugin禁用的WordPress 2.5 Flash图片/视频/媒体与插件上传
- WordPress 2.5 Released for Free Download在WordPress 2.5发布免费下载
- Media Buttons Disabler Plugin to Remove “Add Media” Icons in WordPress 2.5媒体按钮残缺插件删除“添加媒体在WordPress 2.5”图标
- Workaround to Override WordPress Shortcode and Display the [] Brackets Tags解决方法重写WordPress的简码和显示的方括号[]标签
- How to SEO Optimize WordPress 2.5 Blog Web Page Title Without Optimal Title Plugin如何优化搜索引擎优化WordPress的2.5博客网页的标题没有最优标题插件









































