将我的WordPress更新到4.4时,我遇到了以下错误:
致命错误:找不到类“WP\\u Rewrite”
出现错误的页面是我的自定义ajax,代码如下:
<?php
// Constantes propias para ajax
define("SHORTINIT",true);
define(\'WP_USE_THEMES\', false);
define(\'WP_ALLOW_MULTISITE\', false);
if (!defined("AUTH_COOKIE")){
define("AUTH_COOKIE",false);
}
if (!defined("LOGGED_IN_COOKIE")){
define("LOGGED_IN_COOKIE",false);
}
require_once ("../../../../wp-load.php");
//Loading code from wp-settings after SHORTINIT
require( ABSPATH . WPINC . \'/l10n.php\' );
require( ABSPATH . WPINC . \'/formatting.php\' );
require( ABSPATH . WPINC . \'/capabilities.php\' );
require( ABSPATH . WPINC . \'/query.php\' );
require( ABSPATH . WPINC . \'/user.php\' );
require( ABSPATH . WPINC . \'/meta.php\' );
require( ABSPATH . WPINC . \'/general-template.php\' );
require( ABSPATH . WPINC . \'/link-template.php\' );
require( ABSPATH . WPINC . \'/post.php\' );
require( ABSPATH . WPINC . \'/comment.php\' );
require( ABSPATH . WPINC . \'/rewrite.php\' );
require( ABSPATH . WPINC . \'/script-loader.php\' );
require( ABSPATH . WPINC . \'/taxonomy.php\' );
require( ABSPATH . WPINC . \'/theme.php\' );
require( ABSPATH . WPINC . \'/class-wp-walker.php\' );
require( ABSPATH . WPINC . \'/post-template.php\' );
require( ABSPATH . WPINC . \'/post-thumbnail-template.php\' );
require( ABSPATH . WPINC . \'/shortcodes.php\' );
require( ABSPATH . WPINC . \'/media.php\' );
create_initial_taxonomies();
create_initial_post_types();
require( ABSPATH . WPINC . \'/pluggable.php\' );
wp_set_internal_encoding();
wp_functionality_constants( );
$GLOBALS[\'wp_the_query\'] = new WP_Query();
$GLOBALS[\'wp_query\'] = $GLOBALS[\'wp_the_query\'];
$GLOBALS[\'wp_rewrite\'] = new WP_Rewrite();
$GLOBALS[\'wp\'] = new WP();
$GLOBALS[\'wp\']->init();
wp();
if (!defined("WP_CONTENT_URL")){
define("WP_CONTENT_URL",get_option(\'siteurl\').\'/wp-content\');
}
require_once (\'ajax-funciones.php\');
// There I have some acctions
die();
?>
在更新Wordpress之前,我发现WP\\u Rewrite()有一个错误。该类正在文件重写中。php,如果你在法典中寻找,这是包括。
有什么问题吗?