WordPress.org

Make WordPress Core

Changeset 52077


Ignore:
Timestamp:
11/09/2021 06:06:35 PM (4 weeks ago)
Author:
desrosj
Message:

Themes: Avoid fatal error loading admin styles when SCRIPT_DEBUG is false.

This removes the use of get_theme_file_path() within WP_Theme_JSON_Resolver in favor of the similar get_file_path_from_theme() method.

The former is found within wp-includes/link-template.php, which is not currently loaded when load-styles.php attempts to load the necessary styles. self::get_file_path_from_theme() was used previously, but this was changed in [52049].

Props Mamaduka, audrasjb, hellofromTonya, jorbin, desrosj.
Fixes #54401. See #54336.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json-resolver.php

    r52049 r52077  
    364364    public static function theme_has_support() {
    365365        if ( ! isset( self::$theme_has_support ) ) {
    366             self::$theme_has_support = is_readable( get_theme_file_path( 'theme.json' ) );
     366            self::$theme_has_support = is_readable( self::get_file_path_from_theme( 'theme.json' ) );
    367367        }
    368368
Note: See TracChangeset for help on using the changeset viewer.