diff --git a/src/wp-includes/class-walker-category.php b/src/wp-includes/class-walker-category.php
index c881e68..bfea72b 100644
a
|
b
|
class Walker_Category extends Walker { |
111 | 111 | $atts = array(); |
112 | 112 | $atts['href'] = get_term_link( $category ); |
113 | 113 | |
| 114 | // Add aria-curent attribute to the current category. |
| 115 | $_current_terms = get_terms( |
| 116 | $category->taxonomy, |
| 117 | array( |
| 118 | 'include' => $args['current_category'], |
| 119 | 'hide_empty' => false, |
| 120 | ) |
| 121 | ); |
| 122 | $aria_current = ''; |
| 123 | foreach ( $_current_terms as $_current_term ) { |
| 124 | if ( $category->term_id == $_current_term->term_id ) { |
| 125 | $aria_current = ' aria-current="page"'; |
| 126 | } |
| 127 | } |
| 128 | |
114 | 129 | if ( $args['use_desc_for_title'] && ! empty( $category->description ) ) { |
115 | 130 | /** |
116 | 131 | * Filters the category description for display. |
… |
… |
class Walker_Category extends Walker { |
145 | 160 | foreach ( $atts as $attr => $value ) { |
146 | 161 | if ( ! empty( $value ) ) { |
147 | 162 | $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); |
148 | | $attributes .= ' ' . $attr . '="' . $value . '"'; |
| 163 | $attributes .= ' ' . $attr . '="' . $value . '"' . $aria_current; |
149 | 164 | } |
150 | 165 | } |
151 | 166 | |
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 c137849..d9403bf 100644
a
|
b
|
class WP_Widget_Recent_Posts extends WP_Widget { |
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 = ( $recent_post->ID === get_the_ID() ) ? ' aria-current="page"' : ''; |
98 | 99 | ?> |
99 | 100 | <li> |
100 | | <a href="<?php the_permalink( $recent_post->ID ); ?>"><?php echo $title; ?></a> |
| 101 | <a href="<?php the_permalink( $recent_post->ID ); ?>"<?php echo $aria_current; ?>><?php echo $title; ?></a> |
101 | 102 | <?php if ( $show_date ) : ?> |
102 | 103 | <span class="post-date"><?php echo get_the_date( '', $recent_post->ID ); ?></span> |
103 | 104 | <?php endif; ?> |