diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-includes/widgets/class-wp-widget-meta.php --- a/wp/wp-includes/widgets/class-wp-widget-meta.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-includes/widgets/class-wp-widget-meta.php Tue Dec 15 13:49:49 2020 +0100 @@ -42,7 +42,8 @@ * @param array $instance Settings for the current Meta widget instance. */ public function widget( $args, $instance ) { - $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Meta' ); + $default_title = __( 'Meta' ); + $title = ! empty( $instance['title'] ) ? $instance['title'] : $default_title; /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); @@ -52,39 +53,57 @@ if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; } + + $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml'; + + /** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */ + $format = apply_filters( 'navigation_widgets_format', $format ); + + if ( 'html5' === $format ) { + // 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 '