[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 21:31:18 UTC 2015


#35082: get_adjacent_post() when using in term doesn't account for child terms
-------------------------------------------------+-------------------------
 Reporter:  WazzaJB                              |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Posts, Post Types                    |  Release
 Severity:  normal                               |     Version:  trunk
 Keywords:  has-patch has-unit-tests reporter-   |  Resolution:
  feedback                                       |     Focuses:  template
-------------------------------------------------+-------------------------

Comment (by WazzaJB):

 Hi @boonebgorges,

 Thanks for the response.

 Given your first example I'm actually suggesting that post 1 should not go
 through to post 2, because their deepest terms do not match. As only the
 top level terms match I do not deem them 'in the same term'.

 I believe only leaf nodes should be counted when the leaf nodes parent
 also exists within the assigned terms.

 Take the following real-world example:

 We have two categories, 'Tutorials' and child categories of 'NodeJS'  and
 'WordPress'.

 We have a Post 1 that is in the category 'Tutorials' and 'NodeJS'.

 Post 2 is in the category 'Tutorials', but is in a child category of
 'WordPress'.

 Post 3 is in the category 'Tutorials' and 'NodeJS'.

 If I were to use the existing adjacent posts function on post 2, then the
 previous and next posts would be posts 1 & 3.

 So using this real world example, if I wanted to go onto the next
 WordPress 'Tutorial' I would actually arrive at a 'NodeJS' tutorial.

 I hope this has explains things a little better, thanks for bearing with
 me!

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


More information about the wp-trac mailing list