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

WordPress Trac noreply at wordpress.org
Fri Apr 25 14:16:39 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                           |   Keywords:
  Focuses:  ui, administration, performance  |
---------------------------------------------+-----------------------------
 Version: 3.8.3

 Overview: previous_post_link does not return the correct link when posts
 have exactly the same published date. Instead it, skips the post with the
 same published date and returns the next found post.

 Steps to reproduce:

 1) Publish a post. Post A
 2) Using wp-admin create 2 draft posts. Draft B, Draft C
 3) Switch to the post list view /wp-admin/edit.php
 4) Switch to the link showing draft posts /wp-
 admin/edit.php?post_status=draft&post_type=post
 5) Click the checkbox to select all draft posts, then in the Dropdown
 select Edit then Apply.
 6) Change status dropdown to "Published" and then Update.
 7) In single.php add a <?php previous_post_link() ?>
 8) View Draft C, link should point to Draft B, instead it points to Post
 A.

 Fix:

 Quick look indicates that in link-template.php 1179 should be <= and >=

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


More information about the wp-trac mailing list