Opened 10 years ago
Closed 10 years ago
#34473 closed defect (bug) (fixed)
Wrong default order for pages list table in 4.4
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.4 | Priority: | normal |
| Severity: | normal | Version: | 4.4 |
| Component: | Posts, Post Types | Keywords: | has-patch |
| Focuses: | administration | Cc: |
Description
Default order of pages list table in 4.4 is "date". I've investigated source and found that this is caused by function wp_edit_posts_query():
if ( isset( $q['orderby'] ) ) {
$orderby = $q['orderby'];
} elseif ( isset( $q['post_status'] ) && in_array( $q['post_status'], array( 'pending', 'draft' ) ) ) {
$orderby = 'modified';
} else {
$orderby = 'date';
}
}
else statement is causing this problem:
else {
$orderby = 'date';
}
it wasn't present in 4.3.
Attachments (1)
Change History (6)
@
10 years ago
Check that the post type is hierarchical before assuming posts should be listed by date.
#4
@
10 years ago
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
There's a block for hierarchical post types in line 1048, which never runs after [34728], because $orderby is always set now.
34473-wrong-default-order-for-pages.diff looks good. No need to check if $post_type is set though, it's set above.
Note: See
TracTickets for help on using
tickets.
Introduced in [34728].