Block Editor: Load theme resolver class in script loader.

script-loader.php is sometimes called directly and in these situations, the Theme_JSON_Resolver class was not defined.

Props nosolosw, noisysocks.
Fixes #53175.

Built from https://develop.svn.wordpress.org/trunk@51001


git-svn-id: http://core.svn.wordpress.org/trunk@50610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2021-05-25 13:42:58 +00:00
parent cc95428f75
commit f6af848c72
3 changed files with 13 additions and 2 deletions

View File

@ -34,6 +34,17 @@ require ABSPATH . WPINC . '/class.wp-styles.php';
/** WordPress Styles Functions */
require ABSPATH . WPINC . '/functions.wp-styles.php';
/**
* get_stylsheet_directory is used by
* WP_Theme_JSON_Resolver::theme_has_support()
*/
if ( ! function_exists( 'get_stylesheet_directory' ) ) {
require_once ABSPATH . WPINC . '/theme.php';
}
if ( ! class_exists( 'WP_Theme_JSON_Resolver' ) ) {
require_once ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
}
/**
* Registers TinyMCE scripts.
*

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-alpha-51000';
$wp_version = '5.8-alpha-51001';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -299,7 +299,7 @@ require ABSPATH . WPINC . '/class-wp-block-parser.php';
require ABSPATH . WPINC . '/blocks.php';
require ABSPATH . WPINC . '/blocks/index.php';
require ABSPATH . WPINC . '/class-wp-theme-json.php';
require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
require_once ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
require ABSPATH . WPINC . '/block-editor.php';
require ABSPATH . WPINC . '/block-patterns.php';
require ABSPATH . WPINC . '/class-wp-block-supports.php';