Make WordPress Core

Changeset 52347


Ignore:
Timestamp:
12/09/2021 09:54:13 AM (4 years ago)
Author:
youknowriad
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme-templates.php

    r52303 r52347  
    212212 */
    213213function wp_enable_block_templates() {
    214     if ( WP_Theme_JSON_Resolver::theme_has_support() ) {
     214    if ( wp_is_block_theme() || WP_Theme_JSON_Resolver::theme_has_support() ) {
    215215        add_theme_support( 'block-templates' );
    216216    }
Note: See TracChangeset for help on using the changeset viewer.