wp_get_post_revisions() should have a default orderby of date ID to tie-break rapidly added revisions - namely, when unit tests are run. There is a test that occasionally fails when running all tests, and always fails when running phpunit tests/phpunit/tests/post/revisions.php . This fixes that.

Fixes #26042.


Built from https://develop.svn.wordpress.org/trunk@27184


git-svn-id: http://core.svn.wordpress.org/trunk@27044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-02-17 21:23:12 +00:00
parent 1bce8d5b7e
commit 14fba3c926

View File

@ -371,7 +371,7 @@ function wp_get_post_revisions( $post_id = 0, $args = null ) {
if ( ! $post || empty( $post->ID ) ) if ( ! $post || empty( $post->ID ) )
return array(); return array();
$defaults = array( 'order' => 'DESC', 'orderby' => 'date', 'check_enabled' => true ); $defaults = array( 'order' => 'DESC', 'orderby' => 'date ID', 'check_enabled' => true );
$args = wp_parse_args( $args, $defaults ); $args = wp_parse_args( $args, $defaults );
if ( $args['check_enabled'] && ! wp_revisions_enabled( $post ) ) if ( $args['check_enabled'] && ! wp_revisions_enabled( $post ) )