Ticket #26042: 26042.6.diff
File 26042.6.diff, 1.3 KB (added by , 11 years ago) |
---|
-
src/wp-includes/revision.php
417 417 if ( ! $post || empty( $post->ID ) ) 418 418 return array(); 419 419 420 $defaults = array( 'order' => ' ASC', 'orderby' => 'date ID', 'check_enabled' => true );420 $defaults = array( 'order' => 'DESC', 'orderby' => 'date ID', 'check_enabled' => true ); 421 421 $args = wp_parse_args( $args, $defaults ); 422 422 423 423 if ( $args['check_enabled'] && ! wp_revisions_enabled( $post ) ) … … 428 428 if ( ! $revisions = get_children( $args ) ) 429 429 return array(); 430 430 431 $revisions = array_reverse( $revisions );432 433 431 return $revisions; 434 432 } 435 433 -
tests/phpunit/tests/post/revisions.php
353 353 function _filter_query( $sql ) { 354 354 remove_filter( 'query', array( $this, '_filter_query' ) ); 355 355 global $wpdb; 356 $this->assertContains( "ORDER BY $wpdb->posts.post_date ASC, $wpdb->posts.ID ASC", $sql );356 $this->assertContains( "ORDER BY $wpdb->posts.post_date DESC, $wpdb->posts.ID DESC", $sql ); 357 357 return $sql; 358 358 } 359 359