Make WordPress Core

Changeset 51001


Ignore:
Timestamp:
05/25/2021 01:41:30 PM (3 years ago)
Author:
youknowriad
Message:

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.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

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

    r50995 r51001  
    300300require ABSPATH . WPINC . '/blocks/index.php';
    301301require ABSPATH . WPINC . '/class-wp-theme-json.php';
    302 require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
     302require_once ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
    303303require ABSPATH . WPINC . '/block-editor.php';
    304304require ABSPATH . WPINC . '/block-patterns.php';
Note: See TracChangeset for help on using the changeset viewer.