Make WordPress Core

Changeset 51056


Ignore:
Timestamp:
06/01/2021 11:08:29 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Block Editor: Load the WP_Theme_JSON_Resolver class in wp-admin/load-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.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/load-styles.php

    r47855 r51056  
    1414
    1515define( 'WPINC', 'wp-includes' );
     16define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
    1617
    1718require ABSPATH . 'wp-admin/includes/noop.php';
     19require ABSPATH . WPINC . '/theme.php';
     20require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
    1821require ABSPATH . WPINC . '/script-loader.php';
    1922require ABSPATH . WPINC . '/version.php';
  • trunk/src/wp-includes/script-loader.php

    r51023 r51056  
    3434/** WordPress Styles Functions */
    3535require ABSPATH . WPINC . '/functions.wp-styles.php';
    36 
    37 // get_stylesheet_directory() is used by WP_Theme_JSON_Resolver::theme_has_support().
    38 if ( ! function_exists( 'get_stylesheet_directory' ) ) {
    39     require_once ABSPATH . WPINC . '/theme.php';
    40 }
    41 if ( ! class_exists( 'WP_Theme_JSON_Resolver' ) ) {
    42     require_once ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
    43 }
    4436
    4537/**
  • trunk/src/wp-settings.php

    r51021 r51056  
    172172require ABSPATH . WPINC . '/class-wp-theme.php';
    173173require ABSPATH . WPINC . '/class-wp-theme-json.php';
     174require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
    174175require ABSPATH . WPINC . '/class-wp-block-template.php';
    175176require ABSPATH . WPINC . '/block-template-utils.php';
Note: See TracChangeset for help on using the changeset viewer.