Remove unnecessary array_reverse() from wp_get_post_revisions().
WP_Query properly handles multiple 'orderby' values since [28541]. fixes #26042. git-svn-id: https://develop.svn.wordpress.org/trunk@28543 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d6f1c4f904
commit
5edb7a633f
|
@ -417,7 +417,7 @@ function wp_get_post_revisions( $post_id = 0, $args = null ) {
|
|||
if ( ! $post || empty( $post->ID ) )
|
||||
return array();
|
||||
|
||||
$defaults = array( 'order' => 'ASC', 'orderby' => 'date ID', 'check_enabled' => true );
|
||||
$defaults = array( 'order' => 'DESC', 'orderby' => 'date ID', 'check_enabled' => true );
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
|
||||
if ( $args['check_enabled'] && ! wp_revisions_enabled( $post ) )
|
||||
|
@ -428,8 +428,6 @@ function wp_get_post_revisions( $post_id = 0, $args = null ) {
|
|||
if ( ! $revisions = get_children( $args ) )
|
||||
return array();
|
||||
|
||||
$revisions = array_reverse( $revisions );
|
||||
|
||||
return $revisions;
|
||||
}
|
||||
|
||||
|
|
|
@ -353,7 +353,7 @@ class Tests_Post_Revisions extends WP_UnitTestCase {
|
|||
function _filter_query( $sql ) {
|
||||
remove_filter( 'query', array( $this, '_filter_query' ) );
|
||||
global $wpdb;
|
||||
$this->assertContains( "ORDER BY $wpdb->posts.post_date ASC, $wpdb->posts.ID ASC", $sql );
|
||||
$this->assertContains( "ORDER BY $wpdb->posts.post_date DESC, $wpdb->posts.ID DESC", $sql );
|
||||
return $sql;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue