Skip to content

Commit

Permalink
Block Editor: Load theme resolver class in script loader.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
youknowriad committed May 25, 2021
1 parent cc95428 commit f6af848
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@
/** 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.
*
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion wp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
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';
Expand Down

0 comments on commit f6af848

Please sign in to comment.