Ticket #48170: 48170.5.diff
| File 48170.5.diff, 11.3 KB (added by , 6 years ago) |
|---|
-
src/wp-includes/widgets/class-wp-nav-menu-widget.php
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'; 64 61 65 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 } 84 85 /** 66 86 * Filters the arguments for the Navigation Menu widget. 67 87 * 68 88 * @since 4.2.0 -
src/wp-includes/widgets/class-wp-widget-archives.php
120 120 })(); 121 121 /* ]]> */ 122 122 </script> 123 <?php 124 } else { 125 $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; 123 126 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 ); 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 ); 148 136 ?> 149 </ul> 137 138 <?php if ( 'html5' === $format ) : ?> 139 <nav role="navigation"> 140 <?php endif; ?> 141 142 <ul> 143 <?php 144 wp_get_archives( 145 /** 146 * Filters the arguments for the Archives widget. 147 * 148 * @since 2.8.0 149 * @since 4.9.0 Added the `$instance` parameter. 150 * 151 * @see wp_get_archives() 152 * 153 * @param array $args An array of Archives option arguments. 154 * @param array $instance Array of settings for the current widget. 155 */ 156 apply_filters( 157 'widget_archives_args', 158 array( 159 'type' => 'monthly', 160 'show_post_count' => $count, 161 ), 162 $instance 163 ) 164 ); 165 ?> 166 </ul> 167 <?php if ( 'html5' === $format ) : ?> 168 </nav> 169 <?php endif; ?> 170 150 171 <?php 172 echo $args['after_widget']; 151 173 } 152 153 echo $args['after_widget'];154 174 } 155 175 156 176 /** -
src/wp-includes/widgets/class-wp-widget-categories.php
109 109 110 110 <?php 111 111 } else { 112 ?> 113 <ul> 114 <?php 115 $cat_args['title_li'] = ''; 112 $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; 116 113 117 114 /** 118 * Filters the arguments for the Categories widget.115 * Filters the HTML format of widgets with navigation links. 119 116 * 120 * @since 2.8.0 121 * @since 4.9.0 Added the `$instance` parameter. 117 * @since 5.5.0 122 118 * 123 * @param array $cat_args An array of Categories widget options.124 * @param array $instance Array of settings for the current widget.119 * @param string $format The type of markup to use in widgets with navigation links. 120 * Accepts 'html5', 'xhtml'. 125 121 */ 126 wp_list_categories( apply_filters( 'widget_categories_args', $cat_args, $instance ));122 $format = apply_filters( 'navigation_widgets_format', $format ); 127 123 ?> 128 </ul> 124 125 <?php if ( 'html5' === $format ) : ?> 126 <nav role="navigation"> 127 <?php endif; ?> 128 129 <ul> 130 <?php 131 $cat_args['title_li'] = ''; 132 133 /** 134 * Filters the arguments for the Categories widget. 135 * 136 * @since 2.8.0 137 * @since 4.9.0 Added the `$instance` parameter. 138 * 139 * @param array $cat_args An array of Categories widget options. 140 * @param array $instance Array of settings for the current widget. 141 */ 142 wp_list_categories( apply_filters( 'widget_categories_args', $cat_args, $instance ) ); 143 ?> 144 </ul> 145 146 <?php if ( 'html5' === $format ) : ?> 147 </nav> 148 <?php endif; ?> 149 129 150 <?php 130 151 } 131 152 -
src/wp-includes/widgets/class-wp-widget-meta.php
52 52 if ( $title ) { 53 53 echo $args['before_title'] . $title . $args['after_title']; 54 54 } 55 56 $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; 57 58 /** 59 * Filters the HTML format of widgets with navigation links. 60 * 61 * @since 5.5.0 62 * 63 * @param string $format The type of markup to use in widgets with navigation links. 64 * Accepts 'html5', 'xhtml'. 65 */ 66 $format = apply_filters( 'navigation_widgets_format', $format ); 55 67 ?> 56 <ul> 68 69 <?php if ( 'html5' === $format ) : ?> 70 <nav role="navigation"> 71 <?php endif; ?> 72 73 <ul> 57 74 <?php wp_register(); ?> 58 75 <li><?php wp_loginout(); ?></li> 59 76 <li><a href="<?php echo esc_url( get_bloginfo( 'rss2_url' ) ); ?>"><?php _e( 'Entries feed' ); ?></a></li> 60 77 <li><a href="<?php echo esc_url( get_bloginfo( 'comments_rss2_url' ) ); ?>"><?php _e( 'Comments feed' ); ?></a></li> 78 61 79 <?php 62 80 /** 63 81 * Filters the "WordPress.org" list item HTML in the Meta widget. … … 80 98 81 99 wp_meta(); 82 100 ?> 83 </ul>84 <?php85 101 86 echo $args['after_widget']; 102 </ul> 103 104 <?php if ( 'html5' === $format ) : ?> 105 </nav> 106 <?php endif; ?> 107 108 <?php 109 echo $args['after_widget']; 87 110 } 88 111 89 112 /** -
src/wp-includes/widgets/class-wp-widget-pages.php
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 ); 92 104 ?> 93 <ul> 94 <?php echo $out; ?> 95 </ul> 105 106 <?php if ( 'html5' === $format ) : ?> 107 <nav role="navigation"> 108 <?php endif; ?> 109 110 <ul> 111 <?php echo $out; ?> 112 </ul> 113 114 <?php if ( 'html5' === $format ) : ?> 115 </nav> 116 <?php endif; ?> 117 96 118 <?php 97 119 echo $args['after_widget']; 98 120 } -
src/wp-includes/widgets/class-wp-widget-recent-comments.php
123 123 $recent_comments_id = ( $first_instance ) ? 'recentcomments' : "recentcomments-{$this->number}"; 124 124 $first_instance = false; 125 125 126 $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; 127 128 /** 129 * Filters the HTML format of widgets with navigation links. 130 * 131 * @since 5.5.0 132 * 133 * @param string $format The type of markup to use in widgets with navigation links. 134 * Accepts 'html5', 'xhtml'. 135 */ 136 $format = apply_filters( 'navigation_widgets_format', $format ); 137 138 if ( 'html5' === $format ) { 139 $output .= '<nav role="navigation">'; 140 } 141 126 142 $output .= '<ul id="' . esc_attr( $recent_comments_id ) . '">'; 127 143 if ( is_array( $comments ) && $comments ) { 128 144 // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.) … … 141 157 } 142 158 } 143 159 $output .= '</ul>'; 160 161 if ( 'html5' === $format ) { 162 $output .= '</nav>'; 163 } 164 144 165 $output .= $args['after_widget']; 145 166 146 167 echo $output; -
src/wp-includes/widgets/class-wp-widget-recent-posts.php
84 84 return; 85 85 } 86 86 ?> 87 87 88 <?php echo $args['before_widget']; ?> 89 88 90 <?php 89 91 if ( $title ) { 90 92 echo $args['before_title'] . $title . $args['after_title']; 91 93 } 94 95 $format = current_theme_supports( 'html5', 'navigation' ) ? 'html5' : 'xhtml'; 96 97 /** 98 * Filters the HTML format of widgets with navigation links. 99 * 100 * @since 5.5.0 101 * 102 * @param string $format The type of markup to use in widgets with navigation links. 103 * Accepts 'html5', 'xhtml'. 104 */ 105 $format = apply_filters( 'navigation_widgets_format', $format ); 92 106 ?> 107 108 <?php if ( 'html5' === $format ) : ?> 109 <nav role="navigation"> 110 <?php endif; ?> 111 93 112 <ul> 94 113 <?php foreach ( $r->posts as $recent_post ) : ?> 95 114 <?php … … 109 128 </li> 110 129 <?php endforeach; ?> 111 130 </ul> 131 <?php if ( 'html5' === $format ) : ?> 132 </nav> 133 <?php endif; ?> 134 112 135 <?php 113 136 echo $args['after_widget']; 114 137 } -
src/wp-includes/widgets/class-wp-widget-rss.php
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 } 113 97 114 wp_widget_rss_output( $rss, $instance ); 115 116 if ( 'html5' === $format ) { 117 echo '</nav>'; 118 } 119 98 120 echo $args['after_widget']; 99 121 100 122 if ( ! is_wp_error( $rss ) ) {