Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#54731 closed task (blessed) (fixed)

Make block themes fully support HTML5 by default.

Reported by: costdev's profile costdev Owned by: hellofromtonya's profile hellofromTonya
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.9
Component: Themes Keywords: has-patch has-unit-tests commit
Focuses: Cc:

Description

Follow-up to #54597.

This ticket proposes that block themes should fully support HTML5 by default.

Per add_theme_support() - HTML5, this includes:

  • comment-list
  • comment-form
  • search-form
  • gallery
  • caption
  • style
  • script

Attachments (2)

[caption]-before-after.png (6.8 MB) - added by hellofromTonya 3 years ago.
[caption] from original non-block content: before and after patch applied.
[gallery]-before-after.png (2.5 MB) - added by hellofromTonya 3 years ago.
[gallery] from original non-block content: before and after patch applied.

Change History (18)

This ticket was mentioned in PR #2109 on WordPress/wordpress-develop by costdev.


3 years ago
#1

  • Keywords has-patch has-unit-tests added

#2 @costdev
3 years ago

  • Component changed from Editor to Themes

#3 @hellofromTonya
3 years ago

  • Version set to trunk

Bringing the conversation here to this ticket to ensure context is here and those involved get props.

Thank you to @joyously who made the suggestion and pointed out that #54597 was too focused on only block content and not non-block content such as support for [gallery] and [caption] shortcodes.

I asked the question:

For block themes, do you think that Core should automatically default to HTML5 for all content (i.e. block and non-block content)? Or should the block theme itself set the non-block content theme supports (as non-block themes do)?

@joyously shared:

I think it would be good to force HTML5 for block themes, but that's just an opinion.

@costdev shared:

+1 That block themes should use HTML5 by default.

@audrasjb shared:

As far as I can tell, it would make sense if all block themes could only use and provide HTML5 markup. Block themes are a good way to drop non-HTML5 support in long term, if possible :)

#4 @hellofromTonya
3 years ago

What do I think?

I agree. This is a path forward by making new block themes HTML5 out-of-the-box within Core instead of within block themes.

Blocks include their own markup which is already HTML5.

This ticket adds theme supports so that non-block content (original content retained when upgrading to 5.9 and a block theme) is also HTML5.

Please note, non-block themes are not affected this ticket or change.

#5 @hellofromTonya
3 years ago

Follow-up to:

  • #23850 [24417] which added 'search-form'. ''comment-form'', and ''comment-list' HTML5 theme supports.
  • #26697 [27302] which added 'gallery' HTML5 theme support.
  • #31053 [34261] which added 'caption' HTML5 theme support and markup to img_caption_shortcode().

#6 @hellofromTonya
3 years ago

@noisysocks @Mamaduka What do you both think about making block themes default to HTML5 markup? BTW The change in this ticket impacts non-block content in block themes.

#7 @hellofromTonya
3 years ago

  • Type changed from enhancement to task (blessed)

Changing this ticket to blessed task as block theme and code for this change were introduced in 5.9.

#8 @Mamaduka
3 years ago

@hellofromTonya

I agree that block themes should use HTML5 by default.

#9 @hellofromTonya
3 years ago

  • Keywords commit added

w00t thanks @Mamaduka!

Alrighty, marking PR 2109 for commit.

#10 @Mamaduka
3 years ago

Thanks for working on this, @costdev and @hellofromTonya.

Your summary about the decision in the code comment is :chef's kiss emoji:

@hellofromTonya
3 years ago

[caption] from original non-block content: before and after patch applied.

@hellofromTonya
3 years ago

[gallery] from original non-block content: before and after patch applied.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


3 years ago

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


3 years ago

#13 @hellofromTonya
3 years ago

  • Owner set to hellofromTonya
  • Status changed from new to reviewing

Self-assigning for commit.

#14 @hellofromTonya
3 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 52439:

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.

#15 @hellofromTonya
3 years ago

In 52440:

Coding Standard: Remove empty space at end of inline comment in _add_default_theme_supports().

Follow-up to [52439].

See #54731.

Note: See TracTickets for help on using tickets.