diff --git a/src/wp-includes/widgets/class-wp-nav-menu-widget.php b/src/wp-includes/widgets/class-wp-nav-menu-widget.php
index 1edaeac464..3e882202f6 100644
|
a
|
b
|
class WP_Nav_Menu_Widget extends WP_Widget { |
| 57 | 57 | echo $args['before_title'] . $title . $args['after_title']; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | | $nav_menu_args = array( |
| 61 | | 'fallback_cb' => '', |
| 62 | | 'menu' => $nav_menu, |
| 63 | | ); |
| | 60 | if ( function_exists( 'add_theme_support' ) ) { |
| | 61 | if ( get_theme_support( 'html5' ) ) { |
| | 62 | $nav_menu_args = array( |
| | 63 | 'fallback_cb' => '', |
| | 64 | 'menu' => $nav_menu, |
| | 65 | 'items_wrap' => '<nav role="navigation" aria-label="menu"><ul id="%1$s" class="%2$s">%3$s</ul></nav>', |
| | 66 | ); |
| | 67 | } else { |
| | 68 | $nav_menu_args = array( |
| | 69 | 'fallback_cb' => '', |
| | 70 | 'menu' => $nav_menu, |
| | 71 | ); |
| | 72 | } |
| | 73 | } else { |
| | 74 | $nav_menu_args = array( |
| | 75 | 'fallback_cb' => '', |
| | 76 | 'menu' => $nav_menu, |
| | 77 | ); |
| | 78 | } |
| 64 | 79 | |
| 65 | 80 | /** |
| 66 | 81 | * Filters the arguments for the Navigation Menu widget. |
diff --git a/src/wp-includes/widgets/class-wp-widget-archives.php b/src/wp-includes/widgets/class-wp-widget-archives.php
index 2dfd60c7a5..1db0c17cbb 100644
|
a
|
b
|
class WP_Widget_Archives extends WP_Widget { |
| 121 | 121 | /* ]]> */ |
| 122 | 122 | </script> |
| 123 | 123 | |
| 124 | | <?php } else { ?> |
| 125 | | <ul> |
| 126 | | <?php |
| 127 | | wp_get_archives( |
| 128 | | /** |
| 129 | | * Filters the arguments for the Archives widget. |
| 130 | | * |
| 131 | | * @since 2.8.0 |
| 132 | | * @since 4.9.0 Added the `$instance` parameter. |
| 133 | | * |
| 134 | | * @see wp_get_archives() |
| 135 | | * |
| 136 | | * @param array $args An array of Archives option arguments. |
| 137 | | * @param array $instance Array of settings for the current widget. |
| 138 | | */ |
| 139 | | apply_filters( |
| 140 | | 'widget_archives_args', |
| 141 | | array( |
| 142 | | 'type' => 'monthly', |
| 143 | | 'show_post_count' => $count, |
| 144 | | ), |
| 145 | | $instance |
| 146 | | ) |
| 147 | | ); |
| | 124 | <?php } else { |
| | 125 | if ( function_exists( 'add_theme_support' ) ) { |
| | 126 | if ( get_theme_support( 'html5' ) ) { |
| | 127 | ?> |
| | 128 | <nav role="navigation" aria-label="archives list"> |
| | 129 | <?php |
| | 130 | } |
| | 131 | } |
| 148 | 132 | ?> |
| 149 | | </ul> |
| | 133 | <ul> |
| | 134 | <?php |
| | 135 | wp_get_archives( |
| | 136 | /** |
| | 137 | * Filters the arguments for the Archives widget. |
| | 138 | * |
| | 139 | * @since 2.8.0 |
| | 140 | * @since 4.9.0 Added the `$instance` parameter. |
| | 141 | * |
| | 142 | * @see wp_get_archives() |
| | 143 | * |
| | 144 | * @param array $args An array of Archives option arguments. |
| | 145 | * @param array $instance Array of settings for the current widget. |
| | 146 | */ |
| | 147 | apply_filters( |
| | 148 | 'widget_archives_args', |
| | 149 | array( |
| | 150 | 'type' => 'monthly', |
| | 151 | 'show_post_count' => $count, |
| | 152 | ), |
| | 153 | $instance |
| | 154 | ) |
| | 155 | ); |
| | 156 | ?> |
| | 157 | </ul> |
| 150 | 158 | <?php |
| | 159 | if ( function_exists( 'add_theme_support' ) ) { |
| | 160 | if ( get_theme_support( 'html5' ) ) { |
| | 161 | ?> |
| | 162 | </nav> |
| | 163 | <?php |
| | 164 | } |
| | 165 | } |
| 151 | 166 | } |
| 152 | 167 | |
| 153 | 168 | echo $args['after_widget']; |
diff --git a/src/wp-includes/widgets/class-wp-widget-categories.php b/src/wp-includes/widgets/class-wp-widget-categories.php
index 60bf6ef819..b63299ea83 100644
|
a
|
b
|
class WP_Widget_Categories extends WP_Widget { |
| 111 | 111 | |
| 112 | 112 | <?php |
| 113 | 113 | } else { |
| | 114 | if ( function_exists( 'add_theme_support' ) ) { |
| | 115 | if ( get_theme_support( 'html5' ) ) { |
| | 116 | ?> |
| | 117 | <nav role="navigation" aria-label="categories list"> |
| | 118 | <?php |
| | 119 | } |
| | 120 | } |
| 114 | 121 | ?> |
| 115 | | <ul> |
| 116 | | <?php |
| 117 | | $cat_args['title_li'] = ''; |
| 118 | | |
| 119 | | /** |
| 120 | | * Filters the arguments for the Categories widget. |
| 121 | | * |
| 122 | | * @since 2.8.0 |
| 123 | | * @since 4.9.0 Added the `$instance` parameter. |
| 124 | | * |
| 125 | | * @param array $cat_args An array of Categories widget options. |
| 126 | | * @param array $instance Array of settings for the current widget. |
| 127 | | */ |
| 128 | | wp_list_categories( apply_filters( 'widget_categories_args', $cat_args, $instance ) ); |
| 129 | | ?> |
| 130 | | </ul> |
| | 122 | <ul> |
| | 123 | <?php |
| | 124 | $cat_args['title_li'] = ''; |
| | 125 | |
| | 126 | /** |
| | 127 | * Filters the arguments for the Categories widget. |
| | 128 | * |
| | 129 | * @since 2.8.0 |
| | 130 | * @since 4.9.0 Added the `$instance` parameter. |
| | 131 | * |
| | 132 | * @param array $cat_args An array of Categories widget options. |
| | 133 | * @param array $instance Array of settings for the current widget. |
| | 134 | */ |
| | 135 | wp_list_categories( apply_filters( 'widget_categories_args', $cat_args, $instance ) ); |
| | 136 | ?> |
| | 137 | </ul> |
| 131 | 138 | <?php |
| | 139 | if ( function_exists( 'add_theme_support' ) ) { |
| | 140 | if ( get_theme_support( 'html5' ) ) { |
| | 141 | ?> |
| | 142 | </nav> |
| | 143 | <?php |
| | 144 | } |
| | 145 | } |
| 132 | 146 | } |
| 133 | 147 | |
| 134 | 148 | echo $args['after_widget']; |
diff --git a/src/wp-includes/widgets/class-wp-widget-meta.php b/src/wp-includes/widgets/class-wp-widget-meta.php
index 33742b368d..f83709c861 100644
|
a
|
b
|
class WP_Widget_Meta extends WP_Widget { |
| 53 | 53 | echo $args['before_title'] . $title . $args['after_title']; |
| 54 | 54 | } |
| 55 | 55 | ?> |
| | 56 | <?php |
| | 57 | if ( function_exists('add_theme_support' ) ) { |
| | 58 | if ( get_theme_support( 'html5' ) ) { |
| | 59 | ?> |
| | 60 | <nav role="navigation" aria-label="meta"> |
| | 61 | <?php |
| | 62 | } |
| | 63 | } |
| | 64 | ?> |
| 56 | 65 | <ul> |
| 57 | 66 | <?php wp_register(); ?> |
| 58 | 67 | <li><?php wp_loginout(); ?></li> |
| … |
… |
class WP_Widget_Meta extends WP_Widget { |
| 82 | 91 | ?> |
| 83 | 92 | </ul> |
| 84 | 93 | <?php |
| | 94 | if ( function_exists( 'add_theme_support' ) ) { |
| | 95 | if ( get_theme_support( 'html5' ) ) { |
| | 96 | ?> |
| | 97 | </nav> |
| | 98 | <?php |
| | 99 | } |
| | 100 | } |
| 85 | 101 | |
| 86 | 102 | echo $args['after_widget']; |
| 87 | 103 | } |
diff --git a/src/wp-includes/widgets/class-wp-widget-pages.php b/src/wp-includes/widgets/class-wp-widget-pages.php
index 94af11d658..d6376af3d2 100644
|
a
|
b
|
class WP_Widget_Pages extends WP_Widget { |
| 89 | 89 | if ( $title ) { |
| 90 | 90 | echo $args['before_title'] . $title . $args['after_title']; |
| 91 | 91 | } |
| | 92 | if ( function_exists( 'add_theme_support' ) ) { |
| | 93 | if ( get_theme_support( 'html5' ) ) { |
| | 94 | ?> |
| | 95 | <nav role="navigation" aria-label="pages"> |
| | 96 | <?php |
| | 97 | } |
| | 98 | } |
| 92 | 99 | ?> |
| 93 | | <ul> |
| 94 | | <?php echo $out; ?> |
| 95 | | </ul> |
| | 100 | <ul> |
| | 101 | <?php echo $out; ?> |
| | 102 | </ul> |
| 96 | 103 | <?php |
| | 104 | if ( function_exists( 'add_theme_support' ) ) { |
| | 105 | if ( get_theme_support( 'html5' ) ) { |
| | 106 | ?> |
| | 107 | </nav> |
| | 108 | <?php |
| | 109 | } |
| | 110 | } |
| 97 | 111 | echo $args['after_widget']; |
| 98 | 112 | } |
| 99 | 113 | } |
diff --git a/src/wp-includes/widgets/class-wp-widget-recent-comments.php b/src/wp-includes/widgets/class-wp-widget-recent-comments.php
index e9da5c1bdc..a24f6ba893 100644
|
a
|
b
|
class WP_Widget_Recent_Comments extends WP_Widget { |
| 125 | 125 | $recent_comments_id = ( $first_instance ) ? 'recentcomments' : "recentcomments-{$this->number}"; |
| 126 | 126 | $first_instance = false; |
| 127 | 127 | |
| | 128 | if ( function_exists( 'add_theme_support' ) ) { |
| | 129 | if ( get_theme_support( 'html5' ) ) { |
| | 130 | $output .= '<nav role="navigation" aria-label="recent comments">'; |
| | 131 | } |
| | 132 | } |
| | 133 | |
| 128 | 134 | $output .= '<ul id="' . esc_attr( $recent_comments_id ) . '">'; |
| 129 | 135 | if ( is_array( $comments ) && $comments ) { |
| 130 | 136 | // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.) |
| … |
… |
class WP_Widget_Recent_Comments extends WP_Widget { |
| 143 | 149 | } |
| 144 | 150 | } |
| 145 | 151 | $output .= '</ul>'; |
| | 152 | |
| | 153 | if ( function_exists( 'add_theme_support' ) ) { |
| | 154 | if ( get_theme_support( 'html5' ) ) { |
| | 155 | $output .= '</nav>'; |
| | 156 | } |
| | 157 | } |
| | 158 | |
| 146 | 159 | $output .= $args['after_widget']; |
| 147 | 160 | |
| 148 | 161 | echo $output; |
diff --git a/src/wp-includes/widgets/class-wp-widget-recent-posts.php b/src/wp-includes/widgets/class-wp-widget-recent-posts.php
index 9767e3b4fc..7e25826e3d 100644
|
a
|
b
|
class WP_Widget_Recent_Posts extends WP_Widget { |
| 89 | 89 | if ( $title ) { |
| 90 | 90 | echo $args['before_title'] . $title . $args['after_title']; |
| 91 | 91 | } |
| | 92 | if ( function_exists( 'add_theme_support' ) ) { |
| | 93 | if ( get_theme_support( 'html5' ) ) { |
| | 94 | ?> |
| | 95 | <nav role="navigation" aria-label="recent posts"> |
| | 96 | <?php |
| | 97 | } |
| | 98 | } |
| 92 | 99 | ?> |
| 93 | 100 | <ul> |
| 94 | 101 | <?php foreach ( $r->posts as $recent_post ) : ?> |
| … |
… |
class WP_Widget_Recent_Posts extends WP_Widget { |
| 110 | 117 | <?php endforeach; ?> |
| 111 | 118 | </ul> |
| 112 | 119 | <?php |
| | 120 | if ( function_exists( 'add_theme_support' ) ) { |
| | 121 | if ( get_theme_support( 'html5' ) ) { |
| | 122 | ?> |
| | 123 | </nav> |
| | 124 | <?php |
| | 125 | } |
| | 126 | } |
| 113 | 127 | echo $args['after_widget']; |
| 114 | 128 | } |
| 115 | 129 | |
diff --git a/src/wp-includes/widgets/class-wp-widget-rss.php b/src/wp-includes/widgets/class-wp-widget-rss.php
index 4e2810a178..c32d8c0bc9 100644
|
a
|
b
|
class WP_Widget_RSS extends WP_Widget { |
| 94 | 94 | if ( $title ) { |
| 95 | 95 | echo $args['before_title'] . $title . $args['after_title']; |
| 96 | 96 | } |
| | 97 | if ( function_exists( 'add_theme_support' ) ) { |
| | 98 | if ( get_theme_support( 'html5' ) ) { |
| | 99 | echo '<nav role="navigation" aria-label="rss">'; |
| | 100 | } |
| | 101 | } |
| 97 | 102 | wp_widget_rss_output( $rss, $instance ); |
| | 103 | if ( function_exists( 'add_theme_support' ) ) { |
| | 104 | if ( get_theme_support( 'html5' ) ) { |
| | 105 | echo '</nav>'; |
| | 106 | } |
| | 107 | } |
| 98 | 108 | echo $args['after_widget']; |
| 99 | 109 | |
| 100 | 110 | if ( ! is_wp_error( $rss ) ) { |