<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[48349] trunk/src/wp-includes: Accessibility: Widgets: Add theme support to make widgets output list of links wrapped within a `<nav>` element.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/48349">48349</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/48349","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>afercia</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-07-06 20:42:14 +0000 (Mon, 06 Jul 2020)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Accessibility: Widgets: Add theme support to make widgets output list of links wrapped within a `<nav>` element.
Widgets that output list of links can now be wrapped within `<nav>` elements to improve semantics and accessibility.
The `<nav>` elements are also native landmark regions, which helps assistive technology users to navigate through them. Themes can opt-in to this new behavior by declaring support for the new `html5` feature `navigation-widgets`.
Props joedolson, simonjanin, audrasjb, afercia.
Fixes <a href="https://core.trac.wordpress.org/ticket/48170">#48170</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesnavmenutemplatephp">trunk/src/wp-includes/nav-menu-template.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsclasswpnavmenuwidgetphp">trunk/src/wp-includes/widgets/class-wp-nav-menu-widget.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsclasswpwidgetarchivesphp">trunk/src/wp-includes/widgets/class-wp-widget-archives.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsclasswpwidgetcategoriesphp">trunk/src/wp-includes/widgets/class-wp-widget-categories.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsclasswpwidgetmetaphp">trunk/src/wp-includes/widgets/class-wp-widget-meta.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsclasswpwidgetpagesphp">trunk/src/wp-includes/widgets/class-wp-widget-pages.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsclasswpwidgetrecentcommentsphp">trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsclasswpwidgetrecentpostsphp">trunk/src/wp-includes/widgets/class-wp-widget-recent-posts.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsclasswpwidgetrssphp">trunk/src/wp-includes/widgets/class-wp-widget-rss.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesnavmenutemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/nav-menu-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/nav-menu-template.php 2020-07-06 20:15:46 UTC (rev 48348)
+++ trunk/src/wp-includes/nav-menu-template.php 2020-07-06 20:42:14 UTC (rev 48349)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,31 +15,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.7.0 Added the `item_spacing` argument.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 5.5.0 Added the `container_aria_label` argument.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * Optional. Array of nav menu arguments.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type int|string|WP_Term $menu Desired menu. Accepts a menu ID, slug, name, or object. Default empty.
- * @type string $menu_class CSS class to use for the ul element which forms the menu. Default 'menu'.
- * @type string $menu_id The ID that is applied to the ul element which forms the menu.
- * Default is the menu slug, incremented.
- * @type string $container Whether to wrap the ul, and what to wrap it with. Default 'div'.
- * @type string $container_class Class that is applied to the container. Default 'menu-{menu slug}-container'.
- * @type string $container_id The ID that is applied to the container. Default empty.
- * @type callable|bool $fallback_cb If the menu doesn't exist, a callback function will fire.
- * Default is 'wp_page_menu'. Set to false for no fallback.
- * @type string $before Text before the link markup. Default empty.
- * @type string $after Text after the link markup. Default empty.
- * @type string $link_before Text before the link text. Default empty.
- * @type string $link_after Text after the link text. Default empty.
- * @type bool $echo Whether to echo the menu or return it. Default true.
- * @type int $depth How many levels of the hierarchy are to be included. 0 means all. Default 0.
- * @type object $walker Instance of a custom walker class. Default empty.
- * @type string $theme_location Theme location to be used. Must be registered with register_nav_menu()
- * in order to be selectable by the user.
- * @type string $items_wrap How the list items should be wrapped. Default is a ul with an id and class.
- * Uses printf() format with numbered placeholders.
- * @type string $item_spacing Whether to preserve whitespace within the menu's HTML. Accepts 'preserve' or 'discard'. Default 'preserve'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type int|string|WP_Term $menu Desired menu. Accepts a menu ID, slug, name, or object. Default empty.
+ * @type string $menu_class CSS class to use for the ul element which forms the menu. Default 'menu'.
+ * @type string $menu_id The ID that is applied to the ul element which forms the menu.
+ * Default is the menu slug, incremented.
+ * @type string $container Whether to wrap the ul, and what to wrap it with. Default 'div'.
+ * @type string $container_class Class that is applied to the container. Default 'menu-{menu slug}-container'.
+ * @type string $container_id The ID that is applied to the container. Default empty.
+ * @type string $container_aria_label The aria-label attribute that is applied to the container when it's a nav element. Default empty.
+ * @type callable|bool $fallback_cb If the menu doesn't exist, a callback function will fire.
+ * Default is 'wp_page_menu'. Set to false for no fallback.
+ * @type string $before Text before the link markup. Default empty.
+ * @type string $after Text after the link markup. Default empty.
+ * @type string $link_before Text before the link text. Default empty.
+ * @type string $link_after Text after the link text. Default empty.
+ * @type bool $echo Whether to echo the menu or return it. Default true.
+ * @type int $depth How many levels of the hierarchy are to be included. 0 means all. Default 0.
+ * @type object $walker Instance of a custom walker class. Default empty.
+ * @type string $theme_location Theme location to be used. Must be registered with register_nav_menu()
+ * in order to be selectable by the user.
+ * @type string $items_wrap How the list items should be wrapped. Default is a ul with an id and class.
+ * Uses printf() format with numbered placeholders.
+ * @type string $item_spacing Whether to preserve whitespace within the menu's HTML. Accepts 'preserve' or 'discard'. Default 'preserve'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void|string|false Void if 'echo' argument is true, menu output if 'echo' is false.
</span><span class="cx" style="display: block; padding: 0 10px"> * False if there are no items or no menu was found.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,23 +50,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> static $menu_id_slugs = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $defaults = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'menu' => '',
- 'container' => 'div',
- 'container_class' => '',
- 'container_id' => '',
- 'menu_class' => 'menu',
- 'menu_id' => '',
- 'echo' => true,
- 'fallback_cb' => 'wp_page_menu',
- 'before' => '',
- 'after' => '',
- 'link_before' => '',
- 'link_after' => '',
- 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
- 'item_spacing' => 'preserve',
- 'depth' => 0,
- 'walker' => '',
- 'theme_location' => '',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'menu' => '',
+ 'container' => 'div',
+ 'container_class' => '',
+ 'container_id' => '',
+ 'container_aria_label' => '',
+ 'menu_class' => 'menu',
+ 'menu_id' => '',
+ 'echo' => true,
+ 'fallback_cb' => 'wp_page_menu',
+ 'before' => '',
+ 'after' => '',
+ 'link_before' => '',
+ 'link_after' => '',
+ 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
+ 'item_spacing' => 'preserve',
+ 'depth' => 0,
+ 'walker' => '',
+ 'theme_location' => '',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = wp_parse_args( $args, $defaults );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -176,7 +179,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $show_container = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $class = $args->container_class ? ' class="' . esc_attr( $args->container_class ) . '"' : ' class="menu-' . $menu->slug . '-container"';
</span><span class="cx" style="display: block; padding: 0 10px"> $id = $args->container_id ? ' id="' . esc_attr( $args->container_id ) . '"' : '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $nav_menu .= '<' . $args->container . $id . $class . '>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $aria_label = ( 'nav' === $args->container && $args->container_aria_label ) ? ' aria-label="' . esc_attr( $args->container_aria_label ) . '"' : '';
+ $nav_menu .= '<' . $args->container . $id . $class . $aria_label . '>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludeswidgetsclasswpnavmenuwidgetphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/widgets/class-wp-nav-menu-widget.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets/class-wp-nav-menu-widget.php 2020-07-06 20:15:46 UTC (rev 48348)
+++ trunk/src/wp-includes/widgets/class-wp-nav-menu-widget.php 2020-07-06 20:42:14 UTC (rev 48349)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,7 +46,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = ! empty( $instance['title'] ) ? $instance['title'] : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $default_title = __( 'Menu' );
+ $title = ! empty( $instance['title'] ) ? $instance['title'] : '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,12 +58,38 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['before_title'] . $title . $args['after_title'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $nav_menu_args = array(
- 'fallback_cb' => '',
- 'menu' => $nav_menu,
- );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Filters the HTML format of widgets with navigation links.
+ *
+ * @since 5.5.0
+ *
+ * @param string $format The type of markup to use in widgets with navigation links.
+ * Accepts 'html5', 'xhtml'.
+ */
+ $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;
+
+ $nav_menu_args = array(
+ 'fallback_cb' => '',
+ 'menu' => $nav_menu,
+ 'container' => 'nav',
+ 'container_aria_label' => $aria_label,
+ 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
+ );
+ } else {
+ $nav_menu_args = array(
+ 'fallback_cb' => '',
+ 'menu' => $nav_menu,
+ );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Filters the arguments for the Navigation Menu widget.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span></span></pre></div>
<a id="trunksrcwpincludeswidgetsclasswpwidgetarchivesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/widgets/class-wp-widget-archives.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets/class-wp-widget-archives.php 2020-07-06 20:15:46 UTC (rev 48348)
+++ trunk/src/wp-includes/widgets/class-wp-widget-archives.php 2020-07-06 20:42:14 UTC (rev 48349)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $instance Settings for the current Archives widget instance.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Archives' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $default_title = __( 'Archives' );
+ $title = ! empty( $instance['title'] ) ? $instance['title'] : $default_title;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,37 +121,60 @@
</span><span class="cx" style="display: block; padding: 0 10px"> })();
</span><span class="cx" style="display: block; padding: 0 10px"> /* ]]> */
</span><span class="cx" style="display: block; padding: 0 10px"> </script>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ } else {
+ $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php } else { ?>
- <ul>
- <?php
- wp_get_archives(
- /**
- * Filters the arguments for the Archives widget.
- *
- * @since 2.8.0
- * @since 4.9.0 Added the `$instance` parameter.
- *
- * @see wp_get_archives()
- *
- * @param array $args An array of Archives option arguments.
- * @param array $instance Array of settings for the current widget.
- */
- apply_filters(
- 'widget_archives_args',
- array(
- 'type' => 'monthly',
- 'show_post_count' => $count,
- ),
- $instance
- )
- );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters the HTML format of widgets with navigation links.
+ *
+ * @since 5.5.0
+ *
+ * @param string $format The type of markup to use in widgets with navigation links.
+ * Accepts 'html5', 'xhtml'.
+ */
+ $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 '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </ul>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ <ul>
+ <?php
+ wp_get_archives(
+ /**
+ * Filters the arguments for the Archives widget.
+ *
+ * @since 2.8.0
+ * @since 4.9.0 Added the `$instance` parameter.
+ *
+ * @see wp_get_archives()
+ *
+ * @param array $args An array of Archives option arguments.
+ * @param array $instance Array of settings for the current widget.
+ */
+ apply_filters(
+ 'widget_archives_args',
+ array(
+ 'type' => 'monthly',
+ 'show_post_count' => $count,
+ ),
+ $instance
+ )
+ );
+ ?>
+ </ul>
+ <?php if ( 'html5' === $format ) : ?>
+ </nav>
+ <?php endif; ?>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo $args['after_widget'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- echo $args['after_widget'];
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludeswidgetsclasswpwidgetcategoriesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/widgets/class-wp-widget-categories.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets/class-wp-widget-categories.php 2020-07-06 20:15:46 UTC (rev 48348)
+++ trunk/src/wp-includes/widgets/class-wp-widget-categories.php 2020-07-06 20:42:14 UTC (rev 48349)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> static $first_dropdown = true;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Categories' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $default_title = __( 'Categories' );
+ $title = ! empty( $instance['title'] ) ? $instance['title'] : $default_title;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,23 +110,47 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <ul>
- <?php
- $cat_args['title_li'] = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Filters the arguments for the Categories widget.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Filters the HTML format of widgets with navigation links.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 2.8.0
- * @since 4.9.0 Added the `$instance` parameter.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 5.5.0
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $cat_args An array of Categories widget options.
- * @param array $instance Array of settings for the current widget.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $format The type of markup to use in widgets with navigation links.
+ * Accepts 'html5', 'xhtml'.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_list_categories( apply_filters( 'widget_categories_args', $cat_args, $instance ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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 '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </ul>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ <ul>
+ <?php
+ $cat_args['title_li'] = '';
+
+ /**
+ * Filters the arguments for the Categories widget.
+ *
+ * @since 2.8.0
+ * @since 4.9.0 Added the `$instance` parameter.
+ *
+ * @param array $cat_args An array of Categories widget options.
+ * @param array $instance Array of settings for the current widget.
+ */
+ wp_list_categories( apply_filters( 'widget_categories_args', $cat_args, $instance ) );
+ ?>
+ </ul>
+
+ <?php if ( 'html5' === $format ) : ?>
+ </nav>
+ <?php endif; ?>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludeswidgetsclasswpwidgetmetaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/widgets/class-wp-widget-meta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets/class-wp-widget-meta.php 2020-07-06 20:15:46 UTC (rev 48348)
+++ trunk/src/wp-includes/widgets/class-wp-widget-meta.php 2020-07-06 20:42:14 UTC (rev 48349)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,7 +42,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $instance Settings for the current Meta widget instance.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Meta' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $default_title = __( 'Meta' );
+ $title = ! empty( $instance['title'] ) ? $instance['title'] : $default_title;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,12 +53,34 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $title ) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['before_title'] . $title . $args['after_title'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';
+
+ /**
+ * Filters the HTML format of widgets with navigation links.
+ *
+ * @since 5.5.0
+ *
+ * @param string $format The type of markup to use in widgets with navigation links.
+ * Accepts 'html5', 'xhtml'.
+ */
+ $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 '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <ul>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+
+ <ul>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php wp_register(); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <li><?php wp_loginout(); ?></li>
</span><span class="cx" style="display: block; padding: 0 10px"> <li><a href="<?php echo esc_url( get_bloginfo( 'rss2_url' ) ); ?>"><?php _e( 'Entries feed' ); ?></a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> <li><a href="<?php echo esc_url( get_bloginfo( 'comments_rss2_url' ) ); ?>"><?php _e( 'Comments feed' ); ?></a></li>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the "WordPress.org" list item HTML in the Meta widget.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,10 +103,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_meta();
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </ul>
- <?php
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo $args['after_widget'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ </ul>
+
+ <?php if ( 'html5' === $format ) : ?>
+ </nav>
+ <?php endif; ?>
+
+ <?php
+ echo $args['after_widget'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludeswidgetsclasswpwidgetpagesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/widgets/class-wp-widget-pages.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets/class-wp-widget-pages.php 2020-07-06 20:15:46 UTC (rev 48348)
+++ trunk/src/wp-includes/widgets/class-wp-widget-pages.php 2020-07-06 20:42:14 UTC (rev 48349)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $instance Settings for the current Pages widget instance.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Pages' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $default_title = __( 'Pages' );
+ $title = ! empty( $instance['title'] ) ? $instance['title'] : $default_title;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the widget title.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -89,10 +90,35 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $title ) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['before_title'] . $title . $args['after_title'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';
+
+ /**
+ * Filters the HTML format of widgets with navigation links.
+ *
+ * @since 5.5.0
+ *
+ * @param string $format The type of markup to use in widgets with navigation links.
+ * Accepts 'html5', 'xhtml'.
+ */
+ $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 '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <ul>
- <?php echo $out; ?>
- </ul>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ <ul>
+ <?php echo $out; ?>
+ </ul>
+
+ <?php if ( 'html5' === $format ) : ?>
+ </nav>
+ <?php endif; ?>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludeswidgetsclasswpwidgetrecentcommentsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php 2020-07-06 20:15:46 UTC (rev 48348)
+++ trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php 2020-07-06 20:42:14 UTC (rev 48349)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,7 +82,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Comments' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $default_title = __( 'Recent Comments' );
+ $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : $default_title;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,6 +124,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $recent_comments_id = ( $first_instance ) ? 'recentcomments' : "recentcomments-{$this->number}";
</span><span class="cx" style="display: block; padding: 0 10px"> $first_instance = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';
+
+ /**
+ * Filters the HTML format of widgets with navigation links.
+ *
+ * @since 5.5.0
+ *
+ * @param string $format The type of markup to use in widgets with navigation links.
+ * Accepts 'html5', 'xhtml'.
+ */
+ $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;
+ $output .= '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= '<ul id="' . esc_attr( $recent_comments_id ) . '">';
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_array( $comments ) && $comments ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,6 +161,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= '</ul>';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( 'html5' === $format ) {
+ $output .= '</nav>';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> echo $output;
</span></span></pre></div>
<a id="trunksrcwpincludeswidgetsclasswpwidgetrecentpostsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/widgets/class-wp-widget-recent-posts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets/class-wp-widget-recent-posts.php 2020-07-06 20:15:46 UTC (rev 48348)
+++ trunk/src/wp-includes/widgets/class-wp-widget-recent-posts.php 2020-07-06 20:42:14 UTC (rev 48349)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $args['widget_id'] = $this->id;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Posts' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $default_title = __( 'Recent Posts' );
+ $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : $default_title;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,12 +85,34 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php echo $args['before_widget']; ?>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $title ) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['before_title'] . $title . $args['after_title'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';
+
+ /**
+ * Filters the HTML format of widgets with navigation links.
+ *
+ * @since 5.5.0
+ *
+ * @param string $format The type of markup to use in widgets with navigation links.
+ * Accepts 'html5', 'xhtml'.
+ */
+ $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 '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> <ul>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php foreach ( $r->posts as $recent_post ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,6 +132,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </li>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endforeach; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( 'html5' === $format ) : ?>
+ </nav>
+ <?php endif; ?>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludeswidgetsclasswpwidgetrssphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/widgets/class-wp-widget-rss.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets/class-wp-widget-rss.php 2020-07-06 20:15:46 UTC (rev 48348)
+++ trunk/src/wp-includes/widgets/class-wp-widget-rss.php 2020-07-06 20:42:14 UTC (rev 48349)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,7 +94,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $title ) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['before_title'] . $title . $args['after_title'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';
+
+ /**
+ * Filters the HTML format of widgets with navigation links.
+ *
+ * @since 5.5.0
+ *
+ * @param string $format The type of markup to use in widgets with navigation links.
+ * Accepts 'html5', 'xhtml'.
+ */
+ $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 : __( 'RSS Feed' );
+ echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_widget_rss_output( $rss, $instance );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( 'html5' === $format ) {
+ echo '</nav>';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_wp_error( $rss ) ) {
</span></span></pre>
</div>
</div>
</body>
</html>