Ticket #47094: 47094.diff
File 47094.diff, 3.1 KB (added by , 5 years ago) |
---|
-
src/wp-includes/class-walker-category.php
210 210 foreach ( $_current_terms as $_current_term ) { 211 211 if ( $category->term_id == $_current_term->term_id ) { 212 212 $css_classes[] = 'current-cat'; 213 $link = str_replace( '<a', '<a aria-current="page"', $link ); 213 214 } elseif ( $category->term_id == $_current_term->parent ) { 214 215 $css_classes[] = 'current-cat-parent'; 215 216 } -
src/wp-includes/general-template.php
1734 1734 * @return string HTML link content for archive. 1735 1735 */ 1736 1736 function get_archives_link( $url, $text, $format = 'html', $before = '', $after = '', $selected = false ) { 1737 $text = wptexturize( $text ); 1738 $url = esc_url( $url ); 1737 $text = wptexturize( $text ); 1738 $url = esc_url( $url ); 1739 $aria_current = $selected ? ' aria-current="page"' : ''; 1739 1740 1740 if ( 'link' == $format ) {1741 if ( 'link' === $format ) { 1741 1742 $link_html = "\t<link rel='archives' title='" . esc_attr( $text ) . "' href='$url' />\n"; 1742 } elseif ( 'option' == $format ) {1743 } elseif ( 'option' === $format ) { 1743 1744 $selected_attr = $selected ? " selected='selected'" : ''; 1744 1745 $link_html = "\t<option value='$url'$selected_attr>$before $text $after</option>\n"; 1745 } elseif ( 'html' == $format ) {1746 $link_html = "\t<li>$before<a href='$url' >$text</a>$after</li>\n";1746 } elseif ( 'html' === $format ) { 1747 $link_html = "\t<li>$before<a href='$url'$aria_current>$text</a>$after</li>\n"; 1747 1748 } else { // custom 1748 $link_html = "\t$before<a href='$url' >$text</a>$after\n";1749 $link_html = "\t$before<a href='$url'$aria_current>$text</a>$after\n"; 1749 1750 } 1750 1751 1751 1752 /** -
src/wp-includes/widgets/class-wp-widget-recent-posts.php
93 93 <ul> 94 94 <?php foreach ( $r->posts as $recent_post ) : ?> 95 95 <?php 96 $post_title = get_the_title( $recent_post->ID ); 97 $title = ( ! empty( $post_title ) ) ? $post_title : __( '(no title)' ); 96 $post_title = get_the_title( $recent_post->ID ); 97 $title = ( ! empty( $post_title ) ) ? $post_title : __( '(no title)' ); 98 $aria_current = ''; 99 100 if ( is_single() && get_the_ID() === $recent_post->ID ) { 101 $aria_current = ' aria-current="page"'; 102 } 98 103 ?> 99 104 <li> 100 <a href="<?php the_permalink( $recent_post->ID ); ?>" ><?php echo $title; ?></a>105 <a href="<?php the_permalink( $recent_post->ID ); ?>"<?php echo $aria_current; ?>><?php echo $title; ?></a> 101 106 <?php if ( $show_date ) : ?> 102 107 <span class="post-date"><?php echo get_the_date( '', $recent_post->ID ); ?></span> 103 108 <?php endif; ?>