mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-28 21:10:16 +00:00
Administration: Set accessible state for list table headers.
Implement `aria-sort` and change icon states to indicate current sort for list tables. Allow screen reader users to get context about the current sort and allow sighted users to know how the table is currently sorted. Props afercia, rianrietveld, joedolson, alexstine, johnjamesjacoby. Fixes #32170. git-svn-id: https://develop.svn.wordpress.org/trunk@55971 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -208,12 +208,20 @@ class WP_Terms_List_Table extends WP_List_Table {
|
||||
* @return array
|
||||
*/
|
||||
protected function get_sortable_columns() {
|
||||
$taxonomy = $this->screen->taxonomy;
|
||||
|
||||
if ( ! isset( $_GET['orderby'] ) && is_taxonomy_hierarchical( $taxonomy ) ) {
|
||||
$name_orderby_text = __( 'Table ordered hierarchically.' );
|
||||
} else {
|
||||
$name_orderby_text = __( 'Table ordered by Name.' );
|
||||
}
|
||||
|
||||
return array(
|
||||
'name' => 'name',
|
||||
'description' => 'description',
|
||||
'slug' => 'slug',
|
||||
'posts' => 'count',
|
||||
'links' => 'count',
|
||||
'name' => array( 'name', false, _x( 'Name', 'term name' ), $name_orderby_text, 'asc' ),
|
||||
'description' => array( 'description', false, __( 'Description' ), __( 'Table ordered by Description.' ) ),
|
||||
'slug' => array( 'slug', false, __( 'Slug' ), __( 'Table ordered by Slug.' ) ),
|
||||
'posts' => array( 'count', false, _x( 'Count', 'Number/count of items' ), __( 'Table ordered by Posts Count.' ) ),
|
||||
'links' => array( 'count', false, __( 'Links' ), __( 'Table ordered by Links.' ) ),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user