Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default theme supports #2029

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/wp-includes/default-filters.php
Expand Up @@ -514,6 +514,7 @@
*/
// Theme.
add_action( 'setup_theme', 'create_initial_theme_features', 0 );
add_action( 'setup_theme', '_add_default_theme_supports', 1 );
add_action( 'wp_loaded', '_custom_header_background_just_in_time' );
add_action( 'wp_head', '_custom_logo_header_styles' );
add_action( 'plugins_loaded', '_wp_customize_include' );
Expand Down
18 changes: 18 additions & 0 deletions src/wp-includes/theme.php
Expand Up @@ -4093,3 +4093,21 @@ function create_initial_theme_features() {
function wp_is_block_theme() {
return wp_get_theme()->is_block_theme();
}

/**
* Adds default theme supports for block themes when the 'setup_theme' action
* fires.
*
* @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' );
}
}