WordPress.org

Make WordPress Core


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

    r41612 r41683  
    287287        $display_tabs = array();
    288288        foreach ( (array) $tabs as $action => $text ) {
    289             $class = ( $action === $tab ) ? ' current' : '';
     289            $current_link_attributes = ( $action === $tab ) ? ' class="current" aria-current="page"' : '';
    290290            $href = self_admin_url('plugin-install.php?tab=' . $action);
    291             $display_tabs['plugin-install-'.$action] = "<a href='$href' class='$class'>$text</a>";
     291            $display_tabs['plugin-install-'.$action] = "<a href='$href'$current_link_attributes>$text</a>";
    292292        }
    293293        // No longer a real tab.
Note: See TracChangeset for help on using the changeset viewer.