General: Remove role="navigation" from nav elements.

Role="navigation" was required for assistive technology to recognize HTML5 element's native ARIA roles while HTML5 and ARIA were being introduced. With the deprecation of IE11, the role attribute is only required when mapping elements that don't have native role.

Props costdev, mukesh27.
Fixes #54054.

git-svn-id: https://develop.svn.wordpress.org/trunk@51967 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Dolson
2021-11-01 21:45:45 +00:00
parent 23b4388bab
commit 162fda69c8
35 changed files with 77 additions and 77 deletions

View File

@@ -133,7 +133,7 @@ class WP_Widget_Archives extends WP_Widget {
// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.
$title = trim( strip_tags( $title ) );
$aria_label = $title ? $title : $default_title;
echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
echo '<nav aria-label="' . esc_attr( $aria_label ) . '">';
}
?>

View File

@@ -120,7 +120,7 @@ class WP_Widget_Categories extends WP_Widget {
// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.
$title = trim( strip_tags( $title ) );
$aria_label = $title ? $title : $default_title;
echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
echo '<nav aria-label="' . esc_attr( $aria_label ) . '">';
}
?>

View File

@@ -64,7 +64,7 @@ class WP_Widget_Meta extends WP_Widget {
// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.
$title = trim( strip_tags( $title ) );
$aria_label = $title ? $title : $default_title;
echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
echo '<nav aria-label="' . esc_attr( $aria_label ) . '">';
}
?>

View File

@@ -101,7 +101,7 @@ class WP_Widget_Pages extends WP_Widget {
// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.
$title = trim( strip_tags( $title ) );
$aria_label = $title ? $title : $default_title;
echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
echo '<nav aria-label="' . esc_attr( $aria_label ) . '">';
}
?>

View File

@@ -134,7 +134,7 @@ class WP_Widget_Recent_Comments extends WP_Widget {
// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.
$title = trim( strip_tags( $title ) );
$aria_label = $title ? $title : $default_title;
$output .= '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
$output .= '<nav aria-label="' . esc_attr( $aria_label ) . '">';
}
$output .= '<ul id="' . esc_attr( $recent_comments_id ) . '">';

View File

@@ -103,7 +103,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.
$title = trim( strip_tags( $title ) );
$aria_label = $title ? $title : $default_title;
echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
echo '<nav aria-label="' . esc_attr( $aria_label ) . '">';
}
?>

View File

@@ -106,7 +106,7 @@ class WP_Widget_RSS extends WP_Widget {
// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.
$title = trim( strip_tags( $title ) );
$aria_label = $title ? $title : __( 'RSS Feed' );
echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
echo '<nav aria-label="' . esc_attr( $aria_label ) . '">';
}
wp_widget_rss_output( $rss, $instance );

View File

@@ -102,7 +102,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.
$title = trim( strip_tags( $title ) );
$aria_label = $title ? $title : $default_title;
echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
echo '<nav aria-label="' . esc_attr( $aria_label ) . '">';
}
echo '<div class="tagcloud">';