Skip to content

Commit

Permalink
Block Editor: Load the WP_Theme_JSON_Resolver class in `wp-admin/lo…
Browse files Browse the repository at this point in the history
…ad-styles.php`.

This ensures correct load order when style concatenation is used, e.g. when `SCRIPT_DEBUG` is off.

Additionally, make sure the `WP_CONTENT_DIR` constant is defined for use in `get_theme_root()` via `get_stylesheet_directory()`.

Follow-up to [50992], [51001], [51013].

Props nosolosw.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@51056


git-svn-id: http://core.svn.wordpress.org/trunk@50665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
SergeyBiryukov committed Jun 1, 2021
1 parent b964d53 commit 033c742
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
3 changes: 3 additions & 0 deletions wp-admin/load-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
}

define( 'WPINC', 'wp-includes' );
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );

require ABSPATH . 'wp-admin/includes/noop.php';
require ABSPATH . WPINC . '/theme.php';
require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
require ABSPATH . WPINC . '/script-loader.php';
require ABSPATH . WPINC . '/version.php';

Expand Down
8 changes: 0 additions & 8 deletions wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@
/** WordPress Styles Functions */
require ABSPATH . WPINC . '/functions.wp-styles.php';

// get_stylesheet_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-51055';
$wp_version = '5.8-alpha-51056';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down
1 change: 1 addition & 0 deletions wp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
require ABSPATH . WPINC . '/theme.php';
require ABSPATH . WPINC . '/class-wp-theme.php';
require ABSPATH . WPINC . '/class-wp-theme-json.php';
require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
require ABSPATH . WPINC . '/class-wp-block-template.php';
require ABSPATH . WPINC . '/block-template-utils.php';
require ABSPATH . WPINC . '/block-template.php';
Expand Down

0 comments on commit 033c742

Please sign in to comment.