[wp-trac] [WordPress Trac] #28026: previous_post_link returns incorrect post when posts have the same published date

WordPress Trac noreply at wordpress.org
Sun Apr 27 18:21:07 UTC 2014


#28026: previous_post_link returns incorrect post when posts have the same
published date
----------------------------+----------------------------------------------
 Reporter:  deplorableword  |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Themes          |     Version:  3.8.3
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:  ui, administration, performance
----------------------------+----------------------------------------------

Comment (by lpointet):

 Problem is, if you accept retrieving same date posts, they will show up
 for both
 {{{get_previous_post()}}} and {{{get_next_post()}}} calls. So when you are
 on Draft C, you will see Draft B for both previous and next posts...
 We could fix it by choosing whether Draft B is ''before'' or ''after''
 Draft C, maybe thanks to their IDs?

 I'll attach a patch with a reviewed 'WHERE' clause for
 {{{get_adjacent_post()}}} function.

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


More information about the wp-trac mailing list