WordPress.org

Make WordPress Core

Opened 3 weeks ago

Closed 9 days ago

#51455 closed defect (bug) (fixed)

Add theme support to make tag cloud widget output list of links wrapped within a <nav> element

Reported by: audrasjb Owned by: SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version:
Component: Widgets Keywords: needs-dev-note has-patch
Focuses: accessibility Cc:

Description

Follow-up to https://core.trac.wordpress.org/ticket/48170#comment:36

Tag cloud widget was missed from #48170.

Attachments (2)

51455.diff (1.1 KB) - added by audrasjb 3 weeks ago.
Accessibility: Widgets: Add theme support to make tag cloud widget output list of links wrapped within a <nav> element.
51455-class-wp-widget-tag-cloud.php.patch (1.3 KB) - added by ravipatel 3 weeks ago.

Download all attachments as: .zip

Change History (7)

@audrasjb
3 weeks ago

Accessibility: Widgets: Add theme support to make tag cloud widget output list of links wrapped within a <nav> element.

#1 @audrasjb
3 weeks ago

  • Keywords has-patch added; needs-patch removed

51455.diff addresses this issue.

Please don't forget to give proper props to @justinahinon who raised the issue in https://core.trac.wordpress.org/ticket/48170#comment:36

#2 @ravipatel
3 weeks ago

@audrasjb @justinahinon
Why not use this code

$title      = trim( strip_tags( $title ) );
$aria_label = $title ? $title : $default_title;

Change With

$title      = wp_strip_all_tags( $title );
$aria_label = $title ? $title : $default_title;

#3 @audrasjb
3 weeks ago

@ravipatel I'd prefer to keep consistency with the other existing widgets code (see category widget for reference) :)

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


9 days ago

#5 @SergeyBiryukov
9 days ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 49177:

Accessibility: Widgets: Conditionally wrap the tag cloud widget in a <nav> element.

If the theme declares support for the html5 feature navigation-widgets, the tag cloud widget is now wrapped in a <nav> element to improve semantics and accessibility.

The <nav> elements are native landmark regions, which helps assistive technology users to navigate through them.

Follow-up to [48349] for other widgets.

Props audrasjb, justinahinon, ravipatel.
Fixes #51455. See #48170.

Note: See TracTickets for help on using tickets.