[wp-trac] [WordPress Trac] #27564: previous_post_link() and next_post_link() returns nothing

WordPress Trac noreply at wordpress.org
Fri Mar 28 05:27:34 UTC 2014


#27564: previous_post_link() and next_post_link() returns nothing
--------------------------+------------------------------
 Reporter:  genkisan      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Themes        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  template
--------------------------+------------------------------

Comment (by jeremyfelt):

 Ok, confirmed.

 In `WP_Adjacent_Post::get_post()`, the taxonomy query looks for slugs. The
 excluded terms passed to `get_adjacent_post()` are expected as an `Array
 or comma-separated list of excluded terms IDs.`. When an ID of `4` is
 passed, it gets queried as a slug and a `0 = 1` is added to the WHERE
 query.

 Attached patch moves the taxonomy query to search by term_id instead.

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


More information about the wp-trac mailing list