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..42946d25e0 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 | $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; |
| | 61 | |
| | 62 | /** |
| | 63 | * Filters the HTML format of widgets with navigation links. |
| | 64 | * |
| | 65 | * @since 5.5.0 |
| | 66 | * |
| | 67 | * @param string $format The type of markup to use in widgets with navigation links. |
| | 68 | * Accepts 'html5', 'xhtml'. |
| | 69 | */ |
| | 70 | $format = apply_filters( 'navigation_widgets_format', $format ); |
| | 71 | |
| | 72 | if ( 'html5' === $format ) { |
| | 73 | $nav_menu_args = array( |
| | 74 | 'fallback_cb' => '', |
| | 75 | 'menu' => $nav_menu, |
| | 76 | 'items_wrap' => '<nav role="navigation"><ul id="%1$s" class="%2$s">%3$s</ul></nav>', |
| | 77 | ); |
| | 78 | } else { |
| | 79 | $nav_menu_args = array( |
| | 80 | 'fallback_cb' => '', |
| | 81 | 'menu' => $nav_menu, |
| | 82 | ); |
| | 83 | } |
| 64 | 84 | |
| 65 | 85 | /** |
| 66 | 86 | * 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..94db519071 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 | $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; |
| | 126 | |
| | 127 | /** |
| | 128 | * Filters the HTML format of widgets with navigation links. |
| | 129 | * |
| | 130 | * @since 5.5.0 |
| | 131 | * |
| | 132 | * @param string $format The type of markup to use in widgets with navigation links. |
| | 133 | * Accepts 'html5', 'xhtml'. |
| | 134 | */ |
| | 135 | $format = apply_filters( 'navigation_widgets_format', $format ); |
| | 136 | |
| | 137 | if ( 'html5' === $format ) { |
| | 138 | ?> |
| | 139 | <nav role="navigation"> |
| | 140 | <?php |
| | 141 | } |
| 148 | 142 | ?> |
| 149 | | </ul> |
| | 143 | <ul> |
| | 144 | <?php |
| | 145 | wp_get_archives( |
| | 146 | /** |
| | 147 | * Filters the arguments for the Archives widget. |
| | 148 | * |
| | 149 | * @since 2.8.0 |
| | 150 | * @since 4.9.0 Added the `$instance` parameter. |
| | 151 | * |
| | 152 | * @see wp_get_archives() |
| | 153 | * |
| | 154 | * @param array $args An array of Archives option arguments. |
| | 155 | * @param array $instance Array of settings for the current widget. |
| | 156 | */ |
| | 157 | apply_filters( |
| | 158 | 'widget_archives_args', |
| | 159 | array( |
| | 160 | 'type' => 'monthly', |
| | 161 | 'show_post_count' => $count, |
| | 162 | ), |
| | 163 | $instance |
| | 164 | ) |
| | 165 | ); |
| | 166 | ?> |
| | 167 | </ul> |
| 150 | 168 | <?php |
| | 169 | if ( 'html5' === $format ) { |
| | 170 | ?> |
| | 171 | </nav> |
| | 172 | <?php |
| | 173 | } |
| 151 | 174 | } |
| 152 | 175 | |
| 153 | 176 | 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..b485a75dd9 100644
|
a
|
b
|
class WP_Widget_Categories extends WP_Widget { |
| 111 | 111 | |
| 112 | 112 | <?php |
| 113 | 113 | } else { |
| 114 | | ?> |
| 115 | | <ul> |
| 116 | | <?php |
| 117 | | $cat_args['title_li'] = ''; |
| | 114 | $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; |
| 118 | 115 | |
| 119 | 116 | /** |
| 120 | | * Filters the arguments for the Categories widget. |
| | 117 | * Filters the HTML format of widgets with navigation links. |
| 121 | 118 | * |
| 122 | | * @since 2.8.0 |
| 123 | | * @since 4.9.0 Added the `$instance` parameter. |
| | 119 | * @since 5.5.0 |
| 124 | 120 | * |
| 125 | | * @param array $cat_args An array of Categories widget options. |
| 126 | | * @param array $instance Array of settings for the current widget. |
| | 121 | * @param string $format The type of markup to use in widgets with navigation links. |
| | 122 | * Accepts 'html5', 'xhtml'. |
| 127 | 123 | */ |
| 128 | | wp_list_categories( apply_filters( 'widget_categories_args', $cat_args, $instance ) ); |
| | 124 | $format = apply_filters( 'navigation_widgets_format', $format ); |
| | 125 | |
| | 126 | if ( 'html5' === $format ) { |
| | 127 | ?> |
| | 128 | <nav role="navigation"> |
| | 129 | <?php |
| | 130 | } |
| 129 | 131 | ?> |
| 130 | | </ul> |
| | 132 | <ul> |
| | 133 | <?php |
| | 134 | $cat_args['title_li'] = ''; |
| | 135 | |
| | 136 | /** |
| | 137 | * Filters the arguments for the Categories widget. |
| | 138 | * |
| | 139 | * @since 2.8.0 |
| | 140 | * @since 4.9.0 Added the `$instance` parameter. |
| | 141 | * |
| | 142 | * @param array $cat_args An array of Categories widget options. |
| | 143 | * @param array $instance Array of settings for the current widget. |
| | 144 | */ |
| | 145 | wp_list_categories( apply_filters( 'widget_categories_args', $cat_args, $instance ) ); |
| | 146 | ?> |
| | 147 | </ul> |
| 131 | 148 | <?php |
| | 149 | if ( 'html5' === $format ) { |
| | 150 | ?> |
| | 151 | </nav> |
| | 152 | <?php |
| | 153 | } |
| 132 | 154 | } |
| 133 | 155 | |
| 134 | 156 | 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..b21e33abf5 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 | $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; |
| | 58 | |
| | 59 | /** |
| | 60 | * Filters the HTML format of widgets with navigation links. |
| | 61 | * |
| | 62 | * @since 5.5.0 |
| | 63 | * |
| | 64 | * @param string $format The type of markup to use in widgets with navigation links. |
| | 65 | * Accepts 'html5', 'xhtml'. |
| | 66 | */ |
| | 67 | $format = apply_filters( 'navigation_widgets_format', $format ); |
| | 68 | |
| | 69 | if ( 'html5' === $format ) { |
| | 70 | ?> |
| | 71 | <nav role="navigation"> |
| | 72 | <?php |
| | 73 | } |
| | 74 | ?> |
| 56 | 75 | <ul> |
| 57 | 76 | <?php wp_register(); ?> |
| 58 | 77 | <li><?php wp_loginout(); ?></li> |
| … |
… |
class WP_Widget_Meta extends WP_Widget { |
| 82 | 101 | ?> |
| 83 | 102 | </ul> |
| 84 | 103 | <?php |
| | 104 | if ( 'html5' === $format ) { |
| | 105 | ?> |
| | 106 | </nav> |
| | 107 | <?php |
| | 108 | } |
| 85 | 109 | |
| 86 | 110 | echo $args['after_widget']; |
| 87 | 111 | } |
diff --git a/src/wp-includes/widgets/class-wp-widget-pages.php b/src/wp-includes/widgets/class-wp-widget-pages.php
index 94af11d658..41d5083561 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 | |
| | 93 | $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; |
| | 94 | |
| | 95 | /** |
| | 96 | * Filters the HTML format of widgets with navigation links. |
| | 97 | * |
| | 98 | * @since 5.5.0 |
| | 99 | * |
| | 100 | * @param string $format The type of markup to use in widgets with navigation links. |
| | 101 | * Accepts 'html5', 'xhtml'. |
| | 102 | */ |
| | 103 | $format = apply_filters( 'navigation_widgets_format', $format ); |
| | 104 | |
| | 105 | if ( 'html5' === $format ) { |
| | 106 | ?> |
| | 107 | <nav role="navigation"> |
| | 108 | <?php |
| | 109 | } |
| 92 | 110 | ?> |
| 93 | | <ul> |
| 94 | | <?php echo $out; ?> |
| 95 | | </ul> |
| | 111 | <ul> |
| | 112 | <?php echo $out; ?> |
| | 113 | </ul> |
| 96 | 114 | <?php |
| | 115 | if ( 'html5' === $format ) { |
| | 116 | ?> |
| | 117 | </nav> |
| | 118 | <?php |
| | 119 | } |
| 97 | 120 | echo $args['after_widget']; |
| 98 | 121 | } |
| 99 | 122 | } |
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..b906d586f4 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 | $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; |
| | 129 | |
| | 130 | /** |
| | 131 | * Filters the HTML format of widgets with navigation links. |
| | 132 | * |
| | 133 | * @since 5.5.0 |
| | 134 | * |
| | 135 | * @param string $format The type of markup to use in widgets with navigation links. |
| | 136 | * Accepts 'html5', 'xhtml'. |
| | 137 | */ |
| | 138 | $format = apply_filters( 'navigation_widgets_format', $format ); |
| | 139 | |
| | 140 | if ( 'html5' === $format ) { |
| | 141 | $output .= '<nav role="navigation">'; |
| | 142 | } |
| | 143 | |
| 128 | 144 | $output .= '<ul id="' . esc_attr( $recent_comments_id ) . '">'; |
| 129 | 145 | if ( is_array( $comments ) && $comments ) { |
| 130 | 146 | // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.) |
| … |
… |
class WP_Widget_Recent_Comments extends WP_Widget { |
| 143 | 159 | } |
| 144 | 160 | } |
| 145 | 161 | $output .= '</ul>'; |
| | 162 | |
| | 163 | if ( 'html5' === $format ) { |
| | 164 | $output .= '</nav>'; |
| | 165 | } |
| | 166 | |
| 146 | 167 | $output .= $args['after_widget']; |
| 147 | 168 | |
| 148 | 169 | 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..b36836c42b 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 | |
| | 93 | $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; |
| | 94 | |
| | 95 | /** |
| | 96 | * Filters the HTML format of widgets with navigation links. |
| | 97 | * |
| | 98 | * @since 5.5.0 |
| | 99 | * |
| | 100 | * @param string $format The type of markup to use in widgets with navigation links. |
| | 101 | * Accepts 'html5', 'xhtml'. |
| | 102 | */ |
| | 103 | $format = apply_filters( 'navigation_widgets_format', $format ); |
| | 104 | |
| | 105 | if ( 'html5' === $format ) { |
| | 106 | ?> |
| | 107 | <nav role="navigation"> |
| | 108 | <?php |
| | 109 | } |
| 92 | 110 | ?> |
| 93 | 111 | <ul> |
| 94 | 112 | <?php foreach ( $r->posts as $recent_post ) : ?> |
| … |
… |
class WP_Widget_Recent_Posts extends WP_Widget { |
| 110 | 128 | <?php endforeach; ?> |
| 111 | 129 | </ul> |
| 112 | 130 | <?php |
| | 131 | if ( 'html5' === $format ) { |
| | 132 | ?> |
| | 133 | </nav> |
| | 134 | <?php |
| | 135 | } |
| 113 | 136 | echo $args['after_widget']; |
| 114 | 137 | } |
| 115 | 138 | |
diff --git a/src/wp-includes/widgets/class-wp-widget-rss.php b/src/wp-includes/widgets/class-wp-widget-rss.php
index 4e2810a178..c9ec5b8df1 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 | |
| | 98 | $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; |
| | 99 | |
| | 100 | /** |
| | 101 | * Filters the HTML format of widgets with navigation links. |
| | 102 | * |
| | 103 | * @since 5.5.0 |
| | 104 | * |
| | 105 | * @param string $format The type of markup to use in widgets with navigation links. |
| | 106 | * Accepts 'html5', 'xhtml'. |
| | 107 | */ |
| | 108 | $format = apply_filters( 'navigation_widgets_format', $format ); |
| | 109 | |
| | 110 | if ( 'html5' === $format ) { |
| | 111 | echo '<nav role="navigation">'; |
| | 112 | } |
| 97 | 113 | wp_widget_rss_output( $rss, $instance ); |
| | 114 | if ( 'html5' === $format ) { |
| | 115 | echo '</nav>'; |
| | 116 | } |
| 98 | 117 | echo $args['after_widget']; |
| 99 | 118 | |
| 100 | 119 | if ( ! is_wp_error( $rss ) ) { |