From 0795991b6fb03f07046c2c6e4062ef16197ee922 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 16 Dec 2021 14:47:04 +0000 Subject: [PATCH] Tests: Add unit tests for theme features that block themes should support by default. By default, block themes should have a few theme supports enabled: * `post-thumbnails` * `responsive-embeds` * `editor-styles` * `html5` for `comment-form`, `comment-list`, `style`, `script` * `automatic-feed-links` They should also load core block assets only when the blocks are rendered. This commit adds the associated tests. Follow-up to [52369]. Props costdev. See #54597. Built from https://develop.svn.wordpress.org/trunk@52383 git-svn-id: http://core.svn.wordpress.org/trunk@51975 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 19 ++++++++++++------- wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 351d7c8546..ed33051c08 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -4168,16 +4168,21 @@ function wp_is_block_theme() { /** * 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() ) { - add_theme_support( 'post-thumbnails' ); - add_theme_support( 'responsive-embeds' ); - add_theme_support( 'editor-styles' ); - add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'style', 'script' ) ); - add_theme_support( 'automatic-feed-links' ); - add_filter( 'should_load_separate_core_block_assets', '__return_true' ); + if ( ! wp_is_block_theme() ) { + return; } + + add_theme_support( 'post-thumbnails' ); + add_theme_support( 'responsive-embeds' ); + add_theme_support( 'editor-styles' ); + add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'style', 'script' ) ); + add_theme_support( 'automatic-feed-links' ); + + add_filter( 'should_load_separate_core_block_assets', '__return_true' ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2755277e98..85466a6781 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-beta3-52382'; +$wp_version = '5.9-beta3-52383'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.