Make WordPress Core

Changeset 52181


Ignore:
Timestamp:
11/16/2021 02:56:42 PM (3 years ago)
Author:
desrosj
Message:

Themes: Check both parent and child themes for a theme.json file.

This updates WP_Theme_JSON_Resolver::theme_has_support() to properly check for a theme.json file in both parent and child themes when determining whether a theme supports block templates.

Follow up to [52077].

Props Mamaduka.
Fixes #54401.

File:
1 edited

Legend:

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

    r52110 r52181  
    364364    public static function theme_has_support() {
    365365        if ( ! isset( self::$theme_has_support ) ) {
    366             self::$theme_has_support = is_readable( self::get_file_path_from_theme( 'theme.json' ) );
     366            self::$theme_has_support = (
     367                is_readable( self::get_file_path_from_theme( 'theme.json' ) ) ||
     368                is_readable( self::get_file_path_from_theme( 'theme.json', true ) )
     369            );
    367370        }
    368371
Note: See TracChangeset for help on using the changeset viewer.