From a125f5e87feee39b75ab85440048499305788f33 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 16 Nov 2021 14:56:42 +0000 Subject: [PATCH] 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 --- src/wp-includes/class-wp-theme-json-resolver.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-theme-json-resolver.php b/src/wp-includes/class-wp-theme-json-resolver.php index 8e8ddadcb5..f0a12e92fc 100644 --- a/src/wp-includes/class-wp-theme-json-resolver.php +++ b/src/wp-includes/class-wp-theme-json-resolver.php @@ -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;