diff --git a/src/wp-includes/widgets/class-wp-widget-tag-cloud.php b/src/wp-includes/widgets/class-wp-widget-tag-cloud.php
index c23cda21f1..8b5c4a80b9 100644
a
|
b
|
class WP_Widget_Tag_Cloud extends WP_Widget { |
90 | 90 | echo $args['before_title'] . $title . $args['after_title']; |
91 | 91 | } |
92 | 92 | |
| 93 | $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml'; |
| 94 | |
| 95 | /** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */ |
| 96 | $format = apply_filters( 'navigation_widgets_format', $format ); |
| 97 | |
| 98 | if ( 'html5' === $format ) { |
| 99 | // The title may be filtered: Strip out HTML and make sure the aria-label is never empty. |
| 100 | $title = trim( strip_tags( $title ) ); |
| 101 | $aria_label = $title ? $title : $default_title; |
| 102 | echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">'; |
| 103 | } |
| 104 | |
93 | 105 | echo '<div class="tagcloud">'; |
94 | 106 | |
95 | 107 | echo $tag_cloud; |
96 | 108 | |
97 | 109 | echo "</div>\n"; |
| 110 | |
| 111 | if ( 'html5' === $format ) { |
| 112 | echo '</nav>'; |
| 113 | } |
| 114 | |
98 | 115 | echo $args['after_widget']; |
99 | 116 | } |
100 | 117 | |