Make WordPress Core


Ignore:
Timestamp:
10/02/2017 07:43:02 PM (6 years ago)
Author:
afercia
Message:

Accessibility: List Tables: use aria-current for the views current link.

The aria-current attribute is a simple, effective way to help assistive
technologies users orientate themselves within a list of items. Continues the
introduction in core of the aria-current attribute after [41359] and [41371].

Props joedolson, flixos90, afercia.
Fixes #32399.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r41168 r41683  
    247247
    248248        foreach ( $stati as $status => $label ) {
    249             $class = ( $status === $comment_status ) ? ' class="current"' : '';
     249            $current_link_attributes = '';
     250
     251            if ( $status === $comment_status ) {
     252                $current_link_attributes = ' class="current" aria-current="page"';
     253            }
    250254
    251255            if ( !isset( $num_comments->$status ) )
     
    259263                $link = add_query_arg( 's', esc_attr( wp_unslash( $_REQUEST['s'] ) ), $link );
    260264            */
    261             $status_links[ $status ] = "<a href='$link'$class>" . sprintf(
     265            $status_links[ $status ] = "<a href='$link'$current_link_attributes>" . sprintf(
    262266                translate_nooped_plural( $label, $num_comments->$status ),
    263267                sprintf( '<span class="%s-count">%s</span>',
Note: See TracChangeset for help on using the changeset viewer.