Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years 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's profile audrasjb Owned by: sergeybiryukov's profile 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 4 years 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 4 years ago.

Download all attachments as: .zip

Change History (9)

@audrasjb
4 years ago

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

#1 @audrasjb
4 years 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
4 years 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
4 years 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.


4 years ago

#5 @SergeyBiryukov
4 years 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.


4 years ago

#7 @daisyo
4 years ago

  • Keywords has-dev-note added; needs-dev-note removed
Note: See TracTickets for help on using tickets.