WordPress.org

Make WordPress Core

Opened 13 months ago

Closed 13 months ago

Last modified 11 months 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: has-patch has-dev-note
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 13 months 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 13 months ago.

Download all attachments as: .zip

Change History (9)

@audrasjb
13 months ago

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

#1 @audrasjb
13 months 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
13 months 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
13 months 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.


13 months ago

#5 @SergeyBiryukov
13 months 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.

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


12 months ago

Note: See TracTickets for help on using tickets.