Make WordPress Core


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.

File:
1 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/**
Note: See TracChangeset for help on using the changeset viewer.