Make WordPress Core

Changeset 52369


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.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r52364 r52369  
    515515// Theme.
    516516add_action( 'setup_theme', 'create_initial_theme_features', 0 );
     517add_action( 'setup_theme', '_add_default_theme_supports', 1 );
    517518add_action( 'wp_loaded', '_custom_header_background_just_in_time' );
    518519add_action( 'wp_head', '_custom_logo_header_styles' );
  • 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.