WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/02/2017 07:43:02 PM (3 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-posts-list-table.php

    r41576 r41683  
    232232        $url = add_query_arg( $args, 'edit.php' );
    233233
    234         $class_html = '';
     234        $class_html = $aria_current = '';
    235235        if ( ! empty( $class ) ) {
    236236             $class_html = sprintf(
     
    238238                esc_attr( $class )
    239239            );
     240
     241            if ( 'current' === $class ) {
     242                $aria_current = ' aria-current="page"';
     243            }
    240244        }
    241245
    242246        return sprintf(
    243             '<a href="%s"%s>%s</a>',
     247            '<a href="%s"%s%s>%s</a>',
    244248            esc_url( $url ),
    245249            $class_html,
     250            $aria_current,
    246251            $label
    247252        );
Note: See TracChangeset for help on using the changeset viewer.