Make WordPress Core

Ticket #32170: 32170.8.diff

File 32170.8.diff, 21.0 KB (added by alexstine, 22 months ago)

Refresh and try less verbose approach.

  • src/wp-admin/css/list-tables.css

    diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css
    index 00a6d8c4a0..64c71ca438 100644
    a b table.media .column-title .filename { 
    461461        width: 160px;
    462462}
    463463
     464.sorting-indicators {
     465        display: grid;
     466}
     467
    464468.sorting-indicator {
    465469        display: block;
    466         visibility: hidden;
    467470        width: 10px;
    468471        height: 4px;
    469         margin-top: 8px;
     472        margin-top: 4px;
    470473        margin-left: 7px;
    471474}
    472475
    473476.sorting-indicator:before {
    474         content: "\f142";
    475477        font: normal 20px/1 dashicons;
    476478        speak: never;
    477479        display: inline-block;
    478480        padding: 0;
    479481        top: -4px;
    480482        left: -8px;
    481         color: #3c434a;
    482483        line-height: 0.5;
    483484        position: relative;
    484485        vertical-align: top;
    485486        -webkit-font-smoothing: antialiased;
    486487        -moz-osx-font-smoothing: grayscale;
    487488        text-decoration: none !important;
    488         color: #3c434a;
    489 }
    490 
    491 .column-comments .sorting-indicator:before {
    492         top: 0;
    493         left: -10px;
     489        color: #a7aaad;
    494490}
    495491
    496 th.sorted.asc .sorting-indicator:before,
    497 th.desc:hover span.sorting-indicator:before,
    498 th.desc a:focus span.sorting-indicator:before {
     492.sorting-indicator.asc:before {
    499493        content: "\f142";
    500494}
    501495
    502 th.sorted.desc .sorting-indicator:before,
    503 th.asc:hover span.sorting-indicator:before,
    504 th.asc a:focus span.sorting-indicator:before {
     496.sorting-indicator.desc:before {
    505497        content: "\f140";
    506498}
    507499
     500th.sorted.desc .sorting-indicator.desc:before {
     501        color: #1d2327;
     502}
     503
     504th.sorted.asc .sorting-indicator.asc:before {
     505        color: #1d2327;
     506}
     507
     508th.sorted.asc a:focus .sorting-indicator.asc:before,
     509th.sorted.asc:hover .sorting-indicator.asc:before,
     510th.sorted.desc a:focus .sorting-indicator.desc:before,
     511th.sorted.desc:hover .sorting-indicator.desc:before {
     512        color: #a7aaad;
     513}
     514
     515th.sorted.asc a:focus .sorting-indicator.desc:before,
     516th.sorted.asc:hover .sorting-indicator.desc:before,
     517th.sorted.desc a:focus .sorting-indicator.asc:before,
     518th.sorted.desc:hover .sorting-indicator.asc:before {
     519        color: #1d2327;
     520}
     521
    508522.wp-list-table .toggle-row {
    509523        position: absolute;
    510524        right: 8px;
    tr.wp-locked .row-actions .trash { 
    591605        display: none;
    592606}
    593607
    594 .fixed .column-comments .sorting-indicator {
    595         margin-top: 3px;
    596 }
    597 
    598608#menu-locations-wrap .widefat {
    599609        width: 60%;
    600610}
    th.sorted a span { 
    622632        cursor: pointer;
    623633}
    624634
    625 th.sorted .sorting-indicator,
    626 th.desc:hover span.sorting-indicator,
    627 th.desc a:focus span.sorting-indicator,
    628 th.asc:hover span.sorting-indicator,
    629 th.asc a:focus span.sorting-indicator {
    630         visibility: visible;
    631 }
    632 
    633635.tablenav-pages .current-page {
    634636        margin: 0 2px 0 0;
    635637        font-size: 13px;
  • src/wp-admin/includes/class-wp-comments-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php
    index 176b16718a..b03257e16c 100644
    a b class WP_Comments_List_Table extends WP_List_Table { 
    540540         */
    541541        protected function get_sortable_columns() {
    542542                return array(
    543                         'author'   => 'comment_author',
    544                         'response' => 'comment_post_ID',
     543                        'author'   => array( 'comment_author', false, __( 'Author' ), __( 'Table ordered by Comment Author.' ) ),
     544                        'response' => array( 'comment_post_ID', false, _x( 'In Response To', 'column name' ), __( 'Table ordered by Post Replied To.' ) ),
    545545                        'date'     => 'comment_date',
    546546                );
    547547        }
    class WP_Comments_List_Table extends WP_List_Table { 
    573573
    574574                        if ( $has_items ) {
    575575                                $this->display_tablenav( 'top' );
     576                                if ( ! isset( $_GET['orderby'] ) ) {
     577                                        // In the initial view, Comments are ordered by comment's date but there's no column for that.
     578                                        echo '<p id="table-description" class="screen-reader-text">' . __( 'Table ordered by Comment Date. Descending order.' ) . '</p>';
     579                                } else {
     580                                        $this->print_table_description();
     581                                }
    576582                        }
    577583                }
    578584
    579585                $this->screen->render_screen_reader_content( 'heading_list' );
    580586
    581587                ?>
    582 <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
     588<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" aria-describedby="table-description">
    583589        <thead>
    584590        <tr>
    585591                <?php $this->print_column_headers(); ?>
  • src/wp-admin/includes/class-wp-links-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-links-list-table.php b/src/wp-admin/includes/class-wp-links-list-table.php
    index 17a7950fb5..19b3a222ad 100644
    a b class WP_Links_List_Table extends WP_List_Table { 
    143143         */
    144144        protected function get_sortable_columns() {
    145145                return array(
    146                         'name'    => 'name',
    147                         'url'     => 'url',
    148                         'visible' => 'visible',
    149                         'rating'  => 'rating',
     146                        'name'    => array( 'name', false, _x( 'Name', 'link name' ), __( 'Table ordered by Name.' ), 'asc' ),
     147                        'url'     => array( 'url', false, __( 'URL' ), __( 'Table ordered by URL.' ) ),
     148                        'visible' => array( 'visible', false, __( 'Visible' ), __( 'Table ordered by Visibility.' ) ),
     149                        'rating'  => array( 'rating', false, __( 'Rating' ), __( 'Table ordered by Rating.' ) ),
    150150                );
    151151        }
    152152
  • src/wp-admin/includes/class-wp-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php
    index cd62ae4f31..8a5048156b 100644
    a b class WP_List_Table { 
    11091109         *
    11101110         * The format is:
    11111111         * - `'internal-name' => 'orderby'`
     1112         * - `'internal-name' => array( 'orderby', bool, 'abbr', 'orderby-text', 'initially-sorted-column-order' )` -
    11121113         * - `'internal-name' => array( 'orderby', 'asc' )` - The second element sets the initial sorting order.
    11131114         * - `'internal-name' => array( 'orderby', true )`  - The second element makes the initial order descending.
    11141115         *
     1116         * In the second format, passing true as second parameter will make the initial
     1117         * sorting order be descending. Following parameters add a short column name to
     1118         * be used as 'abbr' attribute, a translatable string for the current sorting
     1119         * and the initial order for the initial sorted column, 'asc' or 'desc' (default: false).
     1120         *
    11151121         * @since 3.1.0
     1122         * @since 6.3.0 Added 'abbr', 'orderby-text' and 'initially-sorted-column-order'.
    11161123         *
    11171124         * @return array
    11181125         */
    class WP_List_Table { 
    12531260                        }
    12541261
    12551262                        $data = (array) $data;
     1263                        // Descending initial sorting.
    12561264                        if ( ! isset( $data[1] ) ) {
    1257                                 $data[1] = false;
     1265                                $data[1] = false;
    12581266                        }
     1267                        // Current sorting translatable string.
     1268                        if ( ! isset( $data[2] ) ) {
     1269                                $data[2] = '';
     1270                        }
     1271                        // Initial view sorted column and asc/desc order, default: false.
     1272                        if ( ! isset( $data[3] ) ) {
     1273                                $data[3] = false;
     1274                        }
     1275                        // Initial order for the initial sorted column, default: false.
     1276                        if ( ! isset( $data[4] ) ) {
     1277                                $data[4] = false;
     1278                        }
    12591279
    12601280                        $sortable[ $id ] = $data;
    12611281                }
    class WP_List_Table { 
    12921312                $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
    12931313                $current_url = remove_query_arg( 'paged', $current_url );
    12941314
     1315                // When users click on a column header to sort by other columns.
    12951316                if ( isset( $_GET['orderby'] ) ) {
    1296                         $current_orderby = $_GET['orderby'];
     1317                        $current_orderby = $_GET['orderby'];
     1318                // In the initial view there's no orderby parameter.
    12971319                } else {
    1298                         $current_orderby = '';
     1320                        $current_orderby = '';
    12991321                }
    13001322
    1301                 if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {
     1323                // Not in the initial view and descending order.
     1324                if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) {
    13021325                        $current_order = 'desc';
    13031326                } else {
    1304                         $current_order = 'asc';
     1327                        // The initial view is not always 'asc' we'll take care of this below.
     1328                        $current_order = 'asc';
    13051329                }
    13061330
    13071331                if ( ! empty( $columns['cb'] ) ) {
    class WP_List_Table { 
    13151339                }
    13161340
    13171341                foreach ( $columns as $column_key => $column_display_name ) {
    1318                         $class = array( 'manage-column', "column-$column_key" );
     1342                        $class          = array( 'manage-column', "column-$column_key" );
     1343                        $aria_sort_attr = '';
     1344                        $abbr_attr      = '';
    13191345
    13201346                        if ( in_array( $column_key, $hidden, true ) ) {
    13211347                                $class[] = 'hidden';
    class WP_List_Table { 
    13321358                        }
    13331359
    13341360                        if ( isset( $sortable[ $column_key ] ) ) {
    1335                                 list( $orderby, $desc_first ) = $sortable[ $column_key ];
    1336 
     1361                                list( $orderby, $desc_first, $abbr, $orderby_text, $initial_order ) = $sortable[$column_key];
     1362
     1363                                /*
     1364                                 * We're in the initial view and there's no $_GET['orderby'] then check if the
     1365                                 * initial sorting information is set in the sortable columns and use that.
     1366                                 */
     1367                                if ( '' === $current_orderby && $initial_order ) {
     1368                                        // Use the initially sorted column $orderby as current orderby.
     1369                                        $current_orderby = $orderby;
     1370                                        // Use the initially sorted column asc/desc order as initial order.
     1371                                        $current_order = $initial_order;
     1372                                }
     1373
     1374                                /*
     1375                                 * True in the initial view when an initial orderby is set via get_sortable_columns()
     1376                                 * and true in the sorted views when the actual $_GET['orderby'] is equal to $orderby.
     1377                                 */
    13371378                                if ( $current_orderby === $orderby ) {
    1338                                         $order = 'asc' === $current_order ? 'desc' : 'asc';
    1339 
     1379                                        // The sorted column. The `aria-sort` attribute must be set only on the sorted column.
     1380                                        if ( 'asc' == $current_order ) {
     1381                                                $order          = 'desc';
     1382                                                $aria_sort_attr = ' aria-sort="ascending"';
     1383                                        } else {
     1384                                                $order          = 'asc';
     1385                                                $aria_sort_attr = ' aria-sort="descending"';
     1386                                        }
    13401387                                        $class[] = 'sorted';
    13411388                                        $class[] = $current_order;
    13421389                                } else {
     1390                                        // The other sortable columns.
    13431391                                        $order = strtolower( $desc_first );
    13441392
    13451393                                        if ( ! in_array( $order, array( 'desc', 'asc' ), true ) ) {
    13461394                                                $order = $desc_first ? 'desc' : 'asc';
    13471395                                        }
    13481396
    1349                                         $class[] = 'sortable';
    1350                                         $class[] = 'desc' === $order ? 'asc' : 'desc';
     1397                                        $class[]    = 'sortable';
     1398                                        $class[]    = 'desc' === $order ? 'asc' : 'desc';
    13511399                                }
    13521400
    1353                                 $column_display_name = sprintf(
    1354                                         '<a href="%s"><span>%s</span><span class="sorting-indicator"></span></a>',
    1355                                         esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ),
    1356                                         $column_display_name
    1357                                 );
    1358                         }
     1401                                // Print an 'abbr' attribute if a value is provided via get_sortable_columns().
     1402                                $abbr_attr           = $abbr ? ' abbr="' . esc_attr( $abbr ) . '"' : '';
     1403                                $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicators"><span class="sorting-indicator asc" aria-hidden="true"></span><span class="sorting-indicator desc" aria-hidden="true"></span></a>';
     1404                        }
    13591405
    13601406                        $tag   = ( 'cb' === $column_key ) ? 'td' : 'th';
    13611407                        $scope = ( 'th' === $tag ) ? 'scope="col"' : '';
    class WP_List_Table { 
    13651411                                $class = "class='" . implode( ' ', $class ) . "'";
    13661412                        }
    13671413
    1368                         echo "<$tag $scope $id $class>$column_display_name</$tag>";
     1414                        echo "<$tag $scope $id $class $aria_sort_attr $abbr_attr>$column_display_name</$tag>";
    13691415                }
    13701416        }
    13711417
     1418        /**
     1419         * Print a table caption with information about current sorting and order.
     1420         *
     1421         * For the table initial view, information about initial orderby and order
     1422         * should be provided via get_sortable_columns().
     1423         *
     1424         * @since 4.3.0
     1425         * @access public
     1426         */
     1427        public function print_table_caption() {
     1428                list( $columns, $hidden, $sortable ) = $this->get_column_info();
     1429
     1430                if ( empty( $sortable ) ) {
     1431                        return;
     1432                }
     1433
     1434                // When users click on a column header to sort by other columns.
     1435                if ( isset( $_GET['orderby'] ) ) {
     1436                        $current_orderby = $_GET['orderby'];
     1437                // In the initial view there's no orderby parameter.
     1438                } else {
     1439                        $current_orderby = '';
     1440                }
     1441
     1442                // Not in the initial view and descending order.
     1443                if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) {
     1444                        $current_order = 'desc';
     1445                } else {
     1446                        // The initial view is not always 'asc' we'll take care of this below.
     1447                        $current_order = 'asc';
     1448                }
     1449
     1450                foreach ( array_keys( $columns ) as $column_key ) {
     1451
     1452                        if ( isset( $sortable[$column_key] ) ) {
     1453
     1454                                list( $orderby, $desc_first, $abbr, $orderby_text, $initial_order ) = $sortable[$column_key];
     1455
     1456                                if ( ! is_string( $orderby_text ) || '' === $orderby_text ) {
     1457                                        return;
     1458                                }
     1459                                /*
     1460                                 * We're in the initial view and there's no $_GET['orderby'] then check if the
     1461                                 * initial sorting information is set in the sortable columns and use that.
     1462                                 */
     1463                                if ( '' === $current_orderby && $initial_order ) {
     1464                                        // Use the initially sorted column $orderby as current orderby.
     1465                                        $current_orderby = $orderby;
     1466                                        // Use the initially sorted column asc/desc order as initial order.
     1467                                        $current_order = $initial_order;
     1468                                }
     1469
     1470                                /*
     1471                                 * True in the initial view when an initial orderby is set via get_sortable_columns()
     1472                                 * and true in the sorted views when the actual $_GET['orderby'] is equal to $orderby.
     1473                                 */
     1474                                if ( $current_orderby == $orderby ) {
     1475                                        $order_text = 'asc' === $current_order ? __( 'Ascending order.' ) : __( 'Descending order.' );
     1476                                        $order_link_desc = __( 'Column header links are sortable.' );
     1477                                        echo '<caption class="screen-reader-text">' . $orderby_text . ' ' . $order_text . ' ' . $order_link_desc . '</caption>';
     1478
     1479                                        return;
     1480                                }
     1481                        }
     1482                }
     1483        }
     1484
    13721485        /**
    13731486         * Displays the table.
    13741487         *
    class WP_List_Table { 
    13821495                $this->screen->render_screen_reader_content( 'heading_list' );
    13831496                ?>
    13841497<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
     1498        <?php $this->print_table_caption(); ?>
    13851499        <thead>
    13861500        <tr>
    13871501                <?php $this->print_column_headers(); ?>
  • src/wp-admin/includes/class-wp-media-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php
    index 746abf3662..f620e2f6f6 100644
    a b class WP_Media_List_Table extends WP_List_Table { 
    389389         */
    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        }
    399399
  • src/wp-admin/includes/class-wp-ms-sites-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-ms-sites-list-table.php b/src/wp-admin/includes/class-wp-ms-sites-list-table.php
    index 6a1cf3a763..27213ebbd8 100644
    a b class WP_MS_Sites_List_Table extends WP_List_Table { 
    389389         * @return array
    390390         */
    391391        protected function get_sortable_columns() {
     392
     393                if ( is_subdomain_install() ) {
     394                        $abbr = __( 'Domain' );
     395                        $blogname_orderby_text = __( 'Table ordered by Site Domain Name.' );
     396                } else {
     397                        $abbr = __( 'Path' );
     398                        $blogname_orderby_text = __( 'Table ordered by Site Path.' );
     399                }
     400
    392401                return array(
    393                         'blogname'    => 'blogname',
    394                         'lastupdated' => 'lastupdated',
    395                         'registered'  => 'blog_id',
     402                        'blogname'    => array( 'blogname', false, $abbr, $blogname_orderby_text ),
     403                        'lastupdated' => array( 'lastupdated', true, __( 'Last Updated' ), __( 'Table ordered by Last Updated.' ) ),
     404                        'registered'  => array( 'blog_id', true, _x( 'Registered', 'site' ), __( 'Table ordered by Site Registered Date.' ), 'desc' ),
    396405                );
    397406        }
    398407
  • src/wp-admin/includes/class-wp-ms-themes-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-ms-themes-list-table.php b/src/wp-admin/includes/class-wp-ms-themes-list-table.php
    index 8245b5a7e8..e0e9b362ba 100644
    a b class WP_MS_Themes_List_Table extends WP_List_Table { 
    343343         */
    344344        protected function get_sortable_columns() {
    345345                return array(
    346                         'name' => 'name',
     346                        'name' => array( 'name', false, __( 'Theme' ), __( 'Table ordered by Theme Name.' ), 'asc' ),
    347347                );
    348348        }
    349349
  • src/wp-admin/includes/class-wp-ms-users-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php
    index a97b507ffd..2715f406a1 100644
    a b class WP_MS_Users_List_Table extends WP_List_Table { 
    212212         */
    213213        protected function get_sortable_columns() {
    214214                return array(
    215                         'username'   => 'login',
    216                         'name'       => 'name',
    217                         'email'      => 'email',
    218                         'registered' => 'id',
     215                        'username'   => array( 'login', false, __( 'Username' ), __( 'Table ordered by Username.' ), 'asc' ),
     216                        'name'       => array( 'name', false, __( 'Name' ), __( 'Table ordered by Name.' ) ),
     217                        'email'      => array( 'email', false, __( 'E-mail' ), __( 'Table ordered by E-mail.' ) ),
     218                        'registered' => array( 'id', false, _x( 'Registered', 'user' ), __( 'Table ordered by User Registered Date.' ) ),
    219219                );
    220220        }
    221221
  • src/wp-admin/includes/class-wp-posts-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php
    index 38498d4ec2..0cb5e2d22c 100644
    a b class WP_Posts_List_Table extends WP_List_Table { 
    760760         * @return array
    761761         */
    762762        protected function get_sortable_columns() {
    763                 return array(
    764                         'title'    => 'title',
    765                         'parent'   => 'parent',
    766                         'comments' => 'comment_count',
    767                         'date'     => array( 'date', true ),
    768                 );
     763
     764                $post_type = $this->screen->post_type;
     765
     766                if ( 'page' === $post_type ) {
     767                        $title_orderby_text = isset( $_GET['orderby'] ) ? __( 'Table ordered by Title.' ) : __( 'Table ordered by Hierarchical Menu Order and Title.' );
     768                        $sortables = array(
     769                                'title'    => array( 'title', false, __( 'Title' ), $title_orderby_text, 'asc' ),
     770                                'parent'   => array( 'parent', false ),
     771                                'comments' => array( 'comment_count', false, __( 'Comments' ), __( 'Table ordered by Comments.' ) ),
     772                                'date'     => array( 'date', true, __( 'Date' ), __( 'Table ordered by Date.' ) ),
     773                        );
     774                } else {
     775                        $sortables = array(
     776                                'title'    => array( 'title', false, __( 'Title' ), __( 'Table ordered by Title.' ) ),
     777                                'parent'   => array( 'parent', false ),
     778                                'comments' => array( 'comment_count', false, __( 'Comments' ), __( 'Table ordered by Comments.' ) ),
     779                                'date'     => array( 'date', true, __( 'Date' ), __( 'Table ordered by Date.' ), 'desc' ),
     780                        );
     781                }
     782                // Custom Post Types: there's a filter for that, see get_column_info().
     783
     784                return $sortables;
    769785        }
    770786
    771787        /**
  • src/wp-admin/includes/class-wp-terms-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-terms-list-table.php b/src/wp-admin/includes/class-wp-terms-list-table.php
    index 482a7afb25..6ae9d1f62b 100644
    a b class WP_Terms_List_Table extends WP_List_Table { 
    208208         * @return array
    209209         */
    210210        protected function get_sortable_columns() {
     211                $taxonomy = $this->screen->taxonomy;
     212
     213                if ( ! isset( $_GET['orderby'] ) && is_taxonomy_hierarchical( $taxonomy ) ) {
     214                        $name_orderby_text = __( 'Table ordered hierarchically.' );
     215                } else {
     216                        $name_orderby_text = __( 'Table ordered by Name.' );
     217                }
     218
    211219                return array(
    212                         'name'        => 'name',
    213                         'description' => 'description',
    214                         'slug'        => 'slug',
    215                         'posts'       => 'count',
    216                         'links'       => 'count',
     220                        'name'        => array( 'name', false, _x( 'Name', 'term name' ), $name_orderby_text, 'asc' ),
     221                        'description' => array( 'description', false, __( 'Description' ), __( 'Table ordered by Description.' ) ),
     222                        'slug'        => array( 'slug', false, __( 'Slug' ), __( 'Table ordered by Slug.' ) ),
     223                        'posts'       => array( 'count', false, _x( 'Count', 'Number/count of items' ), __( 'Table ordered by Posts Count.' ) ),
     224                        'links'       => array( 'count', false, __( 'Links' ), __( 'Table ordered by Links.' ) ),
    217225                );
    218226        }
    219227
  • src/wp-admin/includes/class-wp-users-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-users-list-table.php b/src/wp-admin/includes/class-wp-users-list-table.php
    index cd1fc809fc..11adf9d50b 100644
    a b class WP_Users_List_Table extends WP_List_Table { 
    393393         */
    394394        protected function get_sortable_columns() {
    395395                $columns = array(
    396                         'username' => 'login',
    397                         'email'    => 'email',
     396                        'username' => array( 'login', false, __( 'Username' ), __( 'Table ordered by Username.' ), 'asc' ),
     397                        'email'    => array( 'email', false, __( 'E-mail' ), __( 'Table ordered by E-mail.' ) ),
    398398                );
    399399
    400400                return $columns;