Make WordPress Core


Ignore:
Timestamp:
09/18/2019 12:24:35 PM (5 years ago)
Author:
afercia
Message:

Accessibility: Add aria-current to the Archives, Categories, and Recent Posts widgets output.

The aria-current attribute is a simple, effective, way to help assistive technology users orientate themselves within a list of items.

Continues the introduction in core of the aria-current attribute after [41359] and following changes.

Props audrasjb, melchoyce.
Fixes #47094.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-walker-category.php

    r46088 r46163  
    207207                    if ( $category->term_id == $_current_term->term_id ) {
    208208                        $css_classes[] = 'current-cat';
     209                        $link          = str_replace( '<a', '<a aria-current="page"', $link );
    209210                    } elseif ( $category->term_id == $_current_term->parent ) {
    210211                        $css_classes[] = 'current-cat-parent';
Note: See TracChangeset for help on using the changeset viewer.