After reading operations in wp_save_post_revision, it’s no doubt that wp_get_post_revisions has to return latest revision first. But after #27184 changeset, it seems that it returns oldest revision first.
In #27184 changeset, default values for query was changed.
$defaults = array( 'order' => 'DESC', 'orderby' => 'date ID', 'check_enabled' => true );
Now the order-by clause became like following.
ORDER BY wp_posts.post_date,wp_posts.ID DESC
But it should be:
ORDER BY wp_posts.post_date DESC,wp_posts.ID DESC
- The topic ‘Wp_get_post_revisions doesn't return latest revision first’ is closed to new replies.