Make WordPress Core


Ignore:
Timestamp:
12/14/2021 09:47:51 AM (3 years ago)
Author:
audrasjb
Message:

Editor: Activate missing default theme features for block themes.

By default, block themes should have a few theme supports enabled by default. These are: post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links. This changeset backports the changes introduced in https://github.com/WordPress/gutenberg/pull/35593.

Props noisysocks, ocean90, youknowriad, audrasjb, hellofromTonya.
Fixes #54597.

File:
1 edited

Legend:

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

    r52350 r52369  
    41654165    return wp_get_theme()->is_block_theme();
    41664166}
     4167
     4168/**
     4169 * Adds default theme supports for block themes when the 'setup_theme' action fires.
     4170 *
     4171 * @since 5.9.0
     4172 * @access private
     4173 */
     4174function _add_default_theme_supports() {
     4175    if ( wp_is_block_theme() ) {
     4176        add_theme_support( 'post-thumbnails' );
     4177        add_theme_support( 'responsive-embeds' );
     4178        add_theme_support( 'editor-styles' );
     4179        add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'style', 'script' ) );
     4180        add_theme_support( 'automatic-feed-links' );
     4181        add_filter( 'should_load_separate_core_block_assets', '__return_true' );
     4182    }
     4183}
Note: See TracChangeset for help on using the changeset viewer.