Make WordPress Core


Ignore:
Timestamp:
06/25/2020 11:33:23 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Administration: Correct and simplify the logic for asc and desc arguments in WP_List_Table::get_sortable_columns().

Setting the initial order didn't work as expected due to reversed logic.

Follow-up to [48151].

See #45089.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/includesListTable.php

    r48151 r48165  
    304304            'author'   => array( 'comment_author', true ),
    305305            'response' => 'comment_post_ID',
    306             'date'     => array( 'comment_date', 'dEsC' ), // The ordering support should be case insensitive.
     306            'date'     => array( 'comment_date', 'dEsC' ), // The ordering support should be case-insensitive.
    307307        );
    308308
     
    325325        $this->assertContains( 'column-response sortable desc', $output, 'Mismatch of CSS classes for the comment post ID column.' );
    326326
    327         $this->assertContains( '?orderby=comment_date&order=asc', $output, 'Mismatch of the default link ordering for comment author column. Should be asc.' );
    328         $this->assertContains( 'column-date sortable desc', $output, 'Mismatch of CSS classes for the comment date column.' );
     327        $this->assertContains( '?orderby=comment_date&order=desc', $output, 'Mismatch of the default link ordering for comment date column. Should be asc.' );
     328        $this->assertContains( 'column-date sortable asc', $output, 'Mismatch of CSS classes for the comment date column.' );
    329329    }
    330330
Note: See TracChangeset for help on using the changeset viewer.