Skip to content

Commit

Permalink
Themes: Auto-enable block-templates support for all block themes.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
youknowriad committed Dec 9, 2021
1 parent 59633f8 commit f7d2a2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/theme-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}
}

0 comments on commit f7d2a2e

Please sign in to comment.