I want to use next_post_link
and prev_post_link
to return only the next post in my custom taxonomy of a custom post type. I have a custom post type called "work_posts" which has the taxonomy "work_categories" assigned. The category I want to show is called 'all'. I looked up get_adjacent_post
in the "link-template.php" which has a few filters which should make it possible to make such a query but my SQL is not good enough to make the right query. The hooks are:
get_{$adjacent}_post_join
get_{$adjacent}_post_where
get_{$adjacent}_post_sort
if I log a query in the join hook I get:
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 (3)
how do I modify this to only show posts from my custom taxonomy?