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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52181 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2021-11-16 14:56:42 +00:00
parent a8485376d2
commit a125f5e87f
@@ -363,7 +363,10 @@ class WP_Theme_JSON_Resolver {
*/
public static function theme_has_support() {
if ( ! isset( self::$theme_has_support ) ) {
self::$theme_has_support = is_readable( self::get_file_path_from_theme( 'theme.json' ) );
self::$theme_has_support = (
is_readable( self::get_file_path_from_theme( 'theme.json' ) ) ||
is_readable( self::get_file_path_from_theme( 'theme.json', true ) )
);
}
return self::$theme_has_support;