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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52439 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Tonya Mork
2022-01-04 18:38:52 +00:00
parent e1e9bd5657
commit ba7d3a52b1
2 changed files with 38 additions and 1 deletions

View File

@@ -706,6 +706,8 @@ class Tests_Theme extends WP_UnitTestCase {
* Tests that block themes support a feature by default.
*
* @ticket 54597
* @ticket 54731
*
* @dataProvider data_block_theme_has_default_support
*
* @covers ::_add_default_theme_supports
@@ -763,6 +765,36 @@ class Tests_Theme extends WP_UnitTestCase {
'feature' => 'editor-styles',
),
),
'html5: comment-list' => array(
'support' => array(
'feature' => 'html5',
'sub_feature' => 'comment-list',
),
),
'html5: comment-form' => array(
'support' => array(
'feature' => 'html5',
'sub_feature' => 'comment-form',
),
),
'html5: search-form' => array(
'support' => array(
'feature' => 'html5',
'sub_feature' => 'search-form',
),
),
'html5: gallery' => array(
'support' => array(
'feature' => 'html5',
'sub_feature' => 'gallery',
),
),
'html5: caption' => array(
'support' => array(
'feature' => 'html5',
'sub_feature' => 'caption',
),
),
'html5: style' => array(
'support' => array(
'feature' => 'html5',