首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在wordpress升级之后,我在pluggable.php中找不到pluggable.php

在wordpress升级之后,我在pluggable.php中找不到pluggable.php
EN

Stack Overflow用户
提问于 2016-08-13 11:15:32
回答 1查看 970关注 0票数 1

我正在从一个检查wp用户凭证的应用程序中调用一个php脚本。在我将wordpress从4.3升级到4.4 (和4.5)之前,这很好。现在是我整理这个的时候了,但是我想不出为什么wp-user不再可用了,因为它在包含列表中。

错误: wp_user未在pluggable.php中找到

请看下面的代码。

代码语言:javascript
复制
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'}";
}

我已经找到了解决方案,我现在需要包括以下内容。

代码语言:javascript
复制
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中突然需要这些额外的内容,以及我的解决方案是否有意义?

EN

回答 1

Stack Overflow用户

发布于 2016-08-13 12:49:48

从wordpress.org下载更新的wordpress版本,并替换当前的wp-admin和wp-包含更新的wordpress文件夹。

希望它能成功。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38932105

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档