WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#34567 new enhancement

Improve HTML5 support in frontend

Reported by: flixos90 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: dev-feedback 2nd-opinion
Focuses: Cc:

Description

With this ticket I'd like to discuss about HTML5 support in WordPress. While theme authors are able to add support for HTML5, only some parts of WordPress respond to that appropriately. We have several components (like gallery, search form etc) which can be printed in HTML5 if needed, but then there are lots of other areas which are not printed in valid HTML5.

I would like to know if there is any particular reason that this has not been improved yet or if it's simply something that no one has taken a deeper look into yet.

Some areas that could be improved are:

  • the checked(), selected() and disabled() functions (boolean attributes don't need values)
  • link, style and script tags in WP_Styles and WP_Scripts (type attributes not needed, CDATA not needed, link tags shouldn't have a self-closing slash at the end)
  • meta and link tags hooked into wp_head (no self-closing slash)
  • all img tags generated (no self-closing slash)

The above are probably just a fraction of what could be adjusted. I've always used some custom mu-plugin to address this issue and have valid HTML5 in more locations, but it would be great if Core supported it out-of-the-box.

Of course all HTML code should only be changed if the theme has declared 'html5' support. An important thing to think of here would be whether small things like those above actually need to exist as individual arguments in add_theme_support( 'html5', $arguments ) or if simply adding general support for HTML5 is enough to adjust them.

I'd be glad to work on this enhancement if it was approved for core.

Change History (1)

#1 @flixos90
2 years ago

  • Keywords dev-feedback 2nd-opinion added
Note: See TracTickets for help on using tickets.