[wp-trac] [WordPress Trac] #62338: wp:template-part assigning an ARIA role

WordPress Trac noreply at wordpress.org
Mon Nov 4 16:22:25 UTC 2024


#62338: wp:template-part assigning an ARIA role
-----------------------------+--------------------------------------
 Reporter:  jasonmader       |       Owner:  (none)
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Themes           |     Version:
 Severity:  minor            |  Resolution:
 Keywords:                   |     Focuses:  accessibility, template
-----------------------------+--------------------------------------
Changes (by sabernhardt):

 * focuses:  docs, template => accessibility, template
 * version:  6.6.2 =>


Old description:

> <!-- wp:template-part
> {"slug":"news","tagName":"section","role":"complementary","theme":"mytheme"}
> /-->
>
> If there isn't already a way to give the resulting <section class="wp-
> block-template-part"> an ARIA role, that would be a nice enhancement.

New description:

 `<!-- wp:template-part
 {"slug":"news","tagName":"section","role":"complementary","theme":"mytheme"}
 /-->`

 If there isn't already a way to give the resulting `<section class="wp-
 block-template-part">` an ARIA role, that would be a nice enhancement.

--

Comment:

 For the `complementary` role, you could use `aside` as the `tagName`.
 ([https://developer.mozilla.org/en-
 US/docs/Web/Accessibility/ARIA/Roles/complementary_role MDN says, "If
 possible, use the HTML <aside> element instead."]) Twenty Twenty-Four uses
 it in the [https://core.trac.wordpress.org/browser/tags/6.6.2/src/wp-
 content/themes/twentytwentyfour/patterns/page-home-
 blogging.php?marks=71#L71 "Blogging home" pattern].

 However, would a different role be necessary on the template part
 container element?

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


More information about the wp-trac mailing list