mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 20:54:29 +00:00
Post List Table: Ensure that edit.php with no query string produces the proper markup and links in the date column header.
Add 2 methods to `WP_List_Table`, `->get_orderby()` and `->get_order()`. Override the methods in `WP_Posts_List_Table`. `WP_Posts_List_Table` calls `wp_edit_posts_query()` in `->prepare_items()` which is a wrapper for `wp()`. As such, we can obtain `orderby` and `order` via `get_query_var()`, instead of the URL. Fixes #25493. git-svn-id: https://develop.svn.wordpress.org/trunk@34728 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1004,15 +1004,21 @@ function wp_edit_posts_query( $q = false ) {
|
||||
$perm = 'readable';
|
||||
}
|
||||
|
||||
if ( isset($q['orderby']) )
|
||||
if ( isset( $q['orderby'] ) ) {
|
||||
$orderby = $q['orderby'];
|
||||
elseif ( isset($q['post_status']) && in_array($q['post_status'], array('pending', 'draft')) )
|
||||
} elseif ( isset( $q['post_status'] ) && in_array( $q['post_status'], array( 'pending', 'draft' ) ) ) {
|
||||
$orderby = 'modified';
|
||||
} else {
|
||||
$orderby = 'date';
|
||||
}
|
||||
|
||||
if ( isset($q['order']) )
|
||||
if ( isset( $q['order'] ) ) {
|
||||
$order = $q['order'];
|
||||
elseif ( isset($q['post_status']) && 'pending' == $q['post_status'] )
|
||||
} elseif ( isset( $q['post_status'] ) && 'pending' == $q['post_status'] ) {
|
||||
$order = 'ASC';
|
||||
} else {
|
||||
$order = 'desc';
|
||||
}
|
||||
|
||||
$per_page = "edit_{$post_type}_per_page";
|
||||
$posts_per_page = (int) get_user_option( $per_page );
|
||||
|
||||
Reference in New Issue
Block a user