From e414b65dfea271d02afdcce587976c8fa00514db Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Tue, 4 Jan 2022 18:40:00 +0000 Subject: [PATCH] Themes: Make block themes support HTML5 by default. For block themes, [52369] added HTML5 support for `'comment-list'`, `'comment-form'`, `'style'`, and `'script'`. However, when sites upgrade to 5.9 with non-block content such as a gallery and caption, the markup was not HTML5. This commit adds full HTML5 theme feature support for block themes. Non-block content such as a `[gallery]` and `[caption]` shortcodes will natively be in HMTL5 markup without block themes needing to specifically add `add_theme_support( 'html5, .. )` to the theme. Follow-up to [24417], [27302], [34261], [52369], [52383], [52386]. Props @joyously, costdev, hellofromTonya, audrasjb, Mamaduka, ocean90. Fixes #54731. See #54597. Built from https://develop.svn.wordpress.org/trunk@52439 git-svn-id: http://core.svn.wordpress.org/trunk@52031 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 7 ++++++- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index ed33051c08..7a2b357d0a 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -4181,7 +4181,12 @@ function _add_default_theme_supports() { 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' ) ); + /* + * 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' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 58b9777c83..f0d0b84ba9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-beta4-52438'; +$wp_version = '5.9-beta4-52439'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.