Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
wordpress升级I';在pluggable.php中找不到wp_用户_Php_Wordpress - Fatal编程技术网

wordpress升级I';在pluggable.php中找不到wp_用户

wordpress升级I';在pluggable.php中找不到wp_用户,php,wordpress,Php,Wordpress,我正在从一个检查wp用户凭据的应用程序调用一个php脚本。在我将wordpress从4.3升级到4.4(和4.5)之前,这一切都很好。我真的是该整理一下了,但我不明白为什么wp用户不再可用,因为它在包含列表中 错误:在pluggable.php中找不到wp_用户 请看下面的代码 define( 'SHORTINIT', TRUE ); require_once $abspath . '/wp-load.php'; require_once $abspath . '/wp-includes/us

我正在从一个检查wp用户凭据的应用程序调用一个php脚本。在我将wordpress从4.3升级到4.4(和4.5)之前,这一切都很好。我真的是该整理一下了,但我不明白为什么wp用户不再可用,因为它在包含列表中

错误:在pluggable.php中找不到wp_用户

请看下面的代码

define( 'SHORTINIT', TRUE );

require_once $abspath . '/wp-load.php';
require_once $abspath . '/wp-includes/user.php';
require_once $abspath . '/wp-includes/pluggable.php';
require_once $abspath . '/wp-includes/formatting.php';   
require_once $abspath . '/wp-includes/capabilities.php';
require_once $abspath . '/wp-includes/kses.php';
require_once $abspath . '/wp-includes/meta.php';
require_once $abspath . '/wp-includes/l10n.php';
require_once $abspath . '/wp-includes/class-wp-error.php';
require_once $abspath . '/wp-includes/general-template.php';
require_once $abspath . '/wp-includes/link-template.php';

$the_authenticate = wp_authenticate_username_password('null',$user_name,$user_password);
if( is_wp_error( $the_authenticate ) ) {
    echo '{"error":"The username was not recognised"}';
}
else
{
    $the_user_authenticate_id = $the_authenticate->ID;
    $the_user = get_user_by('login', $user_name);
    $the_user_id = $the_user->ID;
if ( !$the_user ) 
{  
   //echo "{'error':'The username was not recognised'}";
}
我发现解决方案是,我现在需要包括以下内容

require_once $abspath . '/wp-includes/class-wp-roles.php';
require_once $abspath . '/wp-includes/class-wp-user.php';
require_once $abspath . '/wp-includes/class-wp-role.php';

请任何人解释为什么wordpress 4.4中突然需要这些额外的包含,以及我的解决方案是否合理?

从wordpress.org下载更新的wordpress版本,并用更新的wordpress文件夹替换当前的wp管理员和wp包含文件夹

希望它能起作用