id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses 17807 get_adjacent_post() doesn't work with custom taxonomies avaly nacin "If you use `next_post_link('%link', '%title', true)` or `previous_post_link('%link', '%title', true)` to get the adjacent post for a custom post type which has a taxonomy assigned to it, it doesn't work as intended. The bug traces back to `get_adjacent_post()`. If the $in_same_cat parameter is true, then the SQL query built to get the posts are hardcoded using the default 'category' taxonomy. Instead it should allow a custom taxonomy as a parameter and use it in the queries. Example: Custom Post Type: `product` Custom Taxonomy: `color` SQL produced by `get_adjacent_post()` when calling `next_post_link('%link', '%title', true)`: `SELECT p.* FROM wp_posts AS p INNER JOIN wp_term_relationships AS tr ON p.ID = tr.object_id INNER JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'category' AND tt.term_id IN () WHERE p.post_date > '2011-06-14 19:37:08' AND p.post_type = 'product' AND p.post_status = 'publish' AND tt.taxonomy = 'category' ORDER BY p.post_date ASC LIMIT 1` " defect (bug) closed normal 3.8 Taxonomy 3.1.3 normal fixed has-patch needs-refresh needs-codex