From f7d2a2ee9d003633e6c729c0835cd4addd23f9b3 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 9 Dec 2021 09:54:13 +0000 Subject: [PATCH] Themes: Auto-enable block-templates support for all block themes. Block themes without theme.json file used to have block-templates support disabled. This commit brings this in sync with the behavior in the gutenberg plugin. See #54335. git-svn-id: https://develop.svn.wordpress.org/trunk@52347 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/theme-templates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/theme-templates.php b/src/wp-includes/theme-templates.php index d18575099c..e837a2fad5 100644 --- a/src/wp-includes/theme-templates.php +++ b/src/wp-includes/theme-templates.php @@ -211,7 +211,7 @@ function the_block_template_skip_link() { * @since 5.8.0 */ function wp_enable_block_templates() { - if ( WP_Theme_JSON_Resolver::theme_has_support() ) { + if ( wp_is_block_theme() || WP_Theme_JSON_Resolver::theme_has_support() ) { add_theme_support( 'block-templates' ); } }