[wp-trac] [WordPress Trac] #59432: Compliant with W3C coding standards

WordPress Trac noreply at wordpress.org
Mon Nov 6 07:58:21 UTC 2023


#59432: Compliant with W3C coding standards
-------------------------+-------------------------------
 Reporter:  agypten      |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  6.3.1
 Severity:  minor        |  Resolution:
 Keywords:               |     Focuses:  coding-standards
-------------------------+-------------------------------

Comment (by bedas):

 1. There is a `meta` HTML5 support nowhere else documented but clearly
 somehow sometimes intended to be used:
 https://codex.wordpress.org/Theme_Markup. easy enough to make the
 `wp_robots` function (amongst tons of others, like the canonical and the
 rss feed links) respect that HTML5 declaration added by theme support.
 This is not happening however at the moment and Core just prints out `/>`,
 while it should be `>` in a HTML5 theme/site.
 2. The handbook IMO is great but surely not a source of truth over the
 actual standard?
 3. It appears to me that adding HTML5 themes support for scripts and
 styles does indeed remove the `type`. Good, but it does not remove the
 `/>` for the link tag, like when enqueueing styles (but there are
 countless others). We can see an example of this hardcoded `/>` in `"<link
 rel='%s' id='%s-css'%s href='%s'%s media='%s' />\n"`,in
 `WP_Styles->do_item()`. So the statement that a theme has to declare said
 support and it will solve everything is only half-applicable.

 Of course WP is free to choose what is best, but it should also respect
 the choice of the webmaster, which, presuming we allow the HTML5 support,
 should of course also be applied to these "warnings". Adding support does
 not just mean avoiding errors.

 I would suggest that:
 A) the undocumented, but adequate `meta` support gets added where we
 output `meta` tags
 B) All stylesheet links, when the theme declares `styles` HTML5 support,
 come without the `/>`
 C) all other links, like `shortlink`, `canonical`, `generator`, `EditURI`
 and so on, do the same. It remains to be discussed what kind of support
 that is - and if it needs a new one for the HTML5 array (perhaps...
 `link`)

 I can help making the changes - as a matter of facts I have them done for
 a large part locally.
 But as there are _many_ more occasions, I would like to hear what is
 generally planned on this. If the consensus is just "ignore the standards,
 our guide and book says otherwise", I guess developers have other means to
 change the markup with some hooks, or worst case, htmlprocessor.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59432#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list