[wp-trac] [WordPress Trac] #17807: get_adjacent_post() doesn't work with custom taxonomies

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 5 18:33:31 UTC 2011


#17807: get_adjacent_post() doesn't work with custom taxonomies
-------------------------------------+------------------------------
 Reporter:  avaly                    |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Taxonomy                 |     Version:  3.1.3
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+------------------------------
Changes (by billerickson):

 * keywords:  has-patch => has-patch needs-testing


Comment:

 * Added a new argument called $taxonomy with a default value of 'category'
 * Fixed the strings (no breaking out of double-quotes)
 * Added the $taxonomy argument to all the other functions that use
 get_adjacent_post()
 * Updated documentation

 I also considered changing $in_same_cat to $in_same_tax, and
 $excluded_categories to $excluded_terms, but I wasn't sure if it was worth
 all the edits just to rename variables - it doesn't add any additional
 functionality.

 I tried testing the $excluded_categories but I couldn't get them to work
 in trunk, without my modifications. I might be doing something wrong (I've
 never used that feature before).  I created three categories: Category 1,
 Category 2, and Exclude.  I created two posts in Cat 1 and Cat 2
 individually, and one post with all three. When I do the below code with
 true or false (5 = term_id of "exclude"), the next link still leads to the
 post in the exclude category:


 {{{
 <?php next_post_link( '%link', 'Next', true, '5' ); ?>

 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17807#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list