[wp-trac] [WordPress Trac] #42936: get_adjacent_post won't find any posts that are published in the same minute

WordPress Trac noreply at wordpress.org
Sun Oct 11 21:48:25 UTC 2020


#42936: get_adjacent_post won't find any posts that are published in the same
minute
----------------------------------------+---------------------
 Reporter:  sheepysheep60               |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  5.6
Component:  Posts, Post Types           |     Version:  4.9.1
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:
----------------------------------------+---------------------

Comment (by peterwilsoncc):

 I haven't had the chance to test this but I think it could be solved by
 one of two approaches:

 * change the clause to `WHERE p.post_date >= $current_post_date AND p.ID
 != $current_post_id ORDER BY p.post_date, p.ID`
 * use the `WHERE` clause @talldanwp suggests above and use PHP to remove
 the current post ID

 For previous posts, the clause would need to be reversed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/42936#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list