Make WordPress Core

Ticket #32416: 32416.partial.patch

File 32416.partial.patch, 1.5 KB (added by afercia, 9 years ago)

partial fix

  • src/wp-admin/includes/class-wp-media-list-table.php

     
    259259        }
    260260
    261261        protected function get_sortable_columns() {
     262
     263                // the initial sorting is by date and descending
     264                // in the initial view the order on first click on 'Date' should be 'asc'
     265                $desc_first = isset( $_GET['orderby'] ) ? true : false;
     266
    262267                return array(
    263268                        'title'    => 'title',
    264269                        'author'   => 'author',
    265270                        'parent'   => 'parent',
    266271                        'comments' => 'comment_count',
    267                         'date'     => array( 'date', true ),
     272                        'date'     => array( 'date', $desc_first ),
    268273                );
    269274        }
    270275
  • src/wp-admin/includes/class-wp-users-list-table.php

     
    281281         * @return array Array of sortable columns.
    282282         */
    283283        protected function get_sortable_columns() {
     284
     285                // the initial sorting is by username ('login') and ascending
     286                // in the initial view the order on first click on 'Username' should be 'desc'
     287                $desc_first = isset( $_GET['orderby'] ) ? false : true;
     288
    284289                $c = array(
    285                         'username' => 'login',
     290                        'username' => array( 'login', $desc_first ),
    286291                        'name'     => 'name',
    287292                        'email'    => 'email',
    288293                );