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.


git-svn-id: https://develop.svn.wordpress.org/trunk@51001 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Riad Benguella 2021-05-25 13:41:30 +00:00
parent 3d5a37a9bc
commit d66ccc0061
2 changed files with 12 additions and 1 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

@ -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';