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

  1. blogger323
    Posted 1 year 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 1 year ago #

    Right, the ticket that changeset referred to is still being worked on:

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

  3. blogger323
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic