Make WordPress Core


Ignore:
Timestamp:
06/21/2023 09:45:52 PM (18 months ago)
Author:
joedolson
Message:

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.

File:
1 edited

Legend:

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

    r55954 r55971  
    390390    protected function get_sortable_columns() {
    391391        return array(
    392             'title'    => 'title',
    393             'author'   => 'author',
    394             'parent'   => 'parent',
    395             'comments' => 'comment_count',
    396             'date'     => array( 'date', true ),
     392            'title'    => array( 'title', false, _x( 'File', 'column name' ), __( 'Table ordered by File Name.' ) ),
     393            'author'   => array( 'author', false, __( 'Author' ), __( 'Table ordered by Author.' ) ),
     394            'parent'   => array( 'parent', false, _x( 'Uploaded to', 'column name' ), __( 'Table ordered by Uploaded To.' ) ),
     395            'comments' => array( 'comment_count', __( 'Comments' ), false, __( 'Table ordered by Comments.' ) ),
     396            'date'     => array( 'date', true, __( 'Date' ), __( 'Table ordered by Date.' ), 'desc' ),
    397397        );
    398398    }
Note: See TracChangeset for help on using the changeset viewer.