Changeset 48165
- Timestamp:
- 06/25/2020 11:33:23 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-list-table.php
r48162 r48165 1171 1171 $class[] = $current_order; 1172 1172 } else { 1173 if ( in_array( strtolower( $desc_first ), array( 'desc', 'asc' ), true ) ) {1174 $order = 'asc' === strtolower( $desc_first ) ? 'desc' : 'asc'; 1175 } else{1173 $order = strtolower( $desc_first ); 1174 1175 if ( ! in_array( $order, array( 'desc', 'asc' ), true ) ) { 1176 1176 $order = $desc_first ? 'desc' : 'asc'; 1177 1177 } … … 1181 1181 } 1182 1182 1183 $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>'; 1183 $column_display_name = sprintf( 1184 '<a href="%s"><span>%s</span><span class="sorting-indicator"></span></a>', 1185 esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ), 1186 $column_display_name 1187 ); 1184 1188 } 1185 1189 -
trunk/tests/phpunit/tests/admin/includesListTable.php
r48151 r48165 304 304 'author' => array( 'comment_author', true ), 305 305 'response' => 'comment_post_ID', 306 'date' => array( 'comment_date', 'dEsC' ), // The ordering support should be case 306 'date' => array( 'comment_date', 'dEsC' ), // The ordering support should be case-insensitive. 307 307 ); 308 308 … … 325 325 $this->assertContains( 'column-response sortable desc', $output, 'Mismatch of CSS classes for the comment post ID column.' ); 326 326 327 $this->assertContains( '?orderby=comment_date&order= asc', $output, 'Mismatch of the default link ordering for comment authorcolumn. 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.' ); 329 329 } 330 330
Note: See TracChangeset
for help on using the changeset viewer.