mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 05:04:31 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@52383 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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' );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user