[wp-trac] [WordPress Trac] #35082: get_adjacent_post() when using in term doesn't account for child terms

WordPress Trac noreply at wordpress.org
Tue Dec 22 23:03:00 UTC 2015


#35082: get_adjacent_post() when using in term doesn't account for child terms
-------------------------------+-----------------------------
 Reporter:  WazzaJB            |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Future Release
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  needs-patch        |     Focuses:  template
-------------------------------+-----------------------------
Changes (by boonebgorges):

 * keywords:  has-patch has-unit-tests reporter-feedback => needs-patch
 * type:  defect (bug) => enhancement


Comment:

 Thanks for the clarification, @WazzaJB.

 My reading of the parameter `in_same_term` is that it should return the
 next/prev post that *shares any term* with the current post. Your
 suggested change is that only leaf terms should be matched. This is a
 pretty big change in functionality, and I think it's not desirable for
 many use cases. Changing the behavior of `in_same_term` to mean this is, I
 think, not doable. (There are also many edge cases to consider - term
 hierarchies with branches of differing depths, etc.)

 That said, I think it's worth considering how to make it easier to do what
 you want to do. Moving to `WP_Query` for `get_adjacent_post()` would give
 you more robust filters; see #26937. Barring that, we might consider a new
 filter that would allow this behavior to be modified in a non-insane way
 (ie, a technique that does not require filtering the entire SQL string).

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


More information about the wp-trac mailing list