diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 05f24dde66e5fa..b949318149abbe 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -25,13 +25,11 @@ function wp_theme_has_theme_json( $clear_cache = false ) { } // Has the own theme a theme.json? - $candidate = get_stylesheet_directory() . '/theme.json'; - $theme_has_support = is_readable( $candidate ); + $theme_has_support = is_readable( get_stylesheet_directory() . '/theme.json' ); - // Has the parent a theme.json if the theme does not? + // Look up the parent if the child does not have a theme.json. if ( ! $theme_has_support ) { - $candidate = get_template_directory() . '/theme.json'; - $theme_has_support = is_readable( $candidate ); + $theme_has_support = is_readable( get_template_directory() . '/theme.json' ); } return $theme_has_support;