mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@48165 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -303,7 +303,7 @@ class Tests_Admin_includesListTable extends WP_UnitTestCase {
|
||||
$override_sortable_columns = array(
|
||||
'author' => array( 'comment_author', true ),
|
||||
'response' => 'comment_post_ID',
|
||||
'date' => array( 'comment_date', 'dEsC' ), // The ordering support should be case insensitive.
|
||||
'date' => array( 'comment_date', 'dEsC' ), // The ordering support should be case-insensitive.
|
||||
);
|
||||
|
||||
// Stub the get_sortable_columns() method.
|
||||
@@ -324,8 +324,8 @@ class Tests_Admin_includesListTable extends WP_UnitTestCase {
|
||||
$this->assertContains( '?orderby=comment_post_ID&order=asc', $output, 'Mismatch of the default link ordering for comment response column. Should be asc.' );
|
||||
$this->assertContains( 'column-response sortable desc', $output, 'Mismatch of CSS classes for the comment post ID column.' );
|
||||
|
||||
$this->assertContains( '?orderby=comment_date&order=asc', $output, 'Mismatch of the default link ordering for comment author column. Should be asc.' );
|
||||
$this->assertContains( 'column-date sortable desc', $output, 'Mismatch of CSS classes for the comment date column.' );
|
||||
$this->assertContains( '?orderby=comment_date&order=desc', $output, 'Mismatch of the default link ordering for comment date column. Should be asc.' );
|
||||
$this->assertContains( 'column-date sortable asc', $output, 'Mismatch of CSS classes for the comment date column.' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user