WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Wp_get_post_revisions doesn't return latest revision first (3 posts)

  1. blogger323
    Member
    Posted 5 months ago #

    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
  2. Sergey Biryukov
    WordPress Dev
    Posted 5 months ago #

    Right, the ticket that changeset referred to is still being worked on:
    https://core.trac.wordpress.org/ticket/26042#comment:12

    Marking the topic as resolved, as we have a Trac ticket.

  3. blogger323
    Member
    Posted 5 months ago #

    Oh, I missed to find the ticket. Thanks for your comment. And I will wait for an update.

Reply

You must log in to post.

About this Topic

Tags