_add_default_theme_supports

The timeline below displays how wordpress function _add_default_theme_supports has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.4

/**
 * Adds default theme supports for block themes when the 'after_setup_theme' action fires.
 *
 * See {@see 'after_setup_theme'}.
 *
 * @since 5.9.0
 * @access private
 */
function _add_default_theme_supports()
{
    if (!wp_is_block_theme()) {
        return;
    }
    add_theme_support('post-thumbnails');
    add_theme_support('responsive-embeds');
    add_theme_support('editor-styles');
    /*
     * Makes block themes support HTML5 by default for the comment block and search form
     * (which use default template functions) and `[caption]` and `[gallery]` shortcodes.
     * Other blocks contain their own HTML5 markup.
     */
    add_theme_support('html5', array('comment-form', 'comment-list', 'search-form', 'gallery', 'caption', 'style', 'script'));
    add_theme_support('automatic-feed-links');
    add_filter('should_load_separate_core_block_assets', '__return_true');
    /*
     * Remove the Customizer's Menus panel when block theme is active.
     */
    add_filter('customize_panel_active', static function ($active, WP_Customize_Panel $panel) {
        if ('nav_menus' === $panel->id && !current_theme_supports('menus') && !current_theme_supports('widgets')) {
            $active = false;
        }
        return $active;
    }, 10, 2);
}

WordPress Version: 6.1

/**
 * Adds default theme supports for block themes when the 'setup_theme' action fires.
 *
 * See {@see 'setup_theme'}.
 *
 * @since 5.9.0
 * @access private
 */
function _add_default_theme_supports()
{
    if (!wp_is_block_theme()) {
        return;
    }
    add_theme_support('post-thumbnails');
    add_theme_support('responsive-embeds');
    add_theme_support('editor-styles');
    /*
     * Makes block themes support HTML5 by default for the comment block and search form
     * (which use default template functions) and `[caption]` and `[gallery]` shortcodes.
     * Other blocks contain their own HTML5 markup.
     */
    add_theme_support('html5', array('comment-form', 'comment-list', 'search-form', 'gallery', 'caption', 'style', 'script'));
    add_theme_support('automatic-feed-links');
    add_filter('should_load_separate_core_block_assets', '__return_true');
    /*
     * Remove the Customizer's Menus panel when block theme is active.
     */
    add_filter('customize_panel_active', static function ($active, WP_Customize_Panel $panel) {
        if ('nav_menus' === $panel->id && !current_theme_supports('menus') && !current_theme_supports('widgets')) {
            $active = false;
        }
        return $active;
    }, 10, 2);
}

WordPress Version: 5.9

/**
 * Adds default theme supports for block themes when the 'setup_theme' action fires.
 *
 * See {@see 'setup_theme'}.
 *
 * @since 5.9.0
 * @access private
 */
function _add_default_theme_supports()
{
    if (!wp_is_block_theme()) {
        return;
    }
    add_theme_support('post-thumbnails');
    add_theme_support('responsive-embeds');
    add_theme_support('editor-styles');
    /*
     * Makes block themes support HTML5 by default for the comment block and search form
     * (which use default template functions) and `[caption]` and `[gallery]` shortcodes.
     * Other blocks contain their own HTML5 markup.
     */
    add_theme_support('html5', array('comment-form', 'comment-list', 'search-form', 'gallery', 'caption', 'style', 'script'));
    add_theme_support('automatic-feed-links');
    add_filter('should_load_separate_core_block_assets', '__return_true');
}