Wordpress - How can I register a custom taxonomy with the search query param 'tag' in URL and make it work?

Viewed 47

I registered a custom post type e.g animal, registered a taxonomy animal_tag who's query_var is tag. Added posts and assigned theme tags.

Now filtering posts in:

/wp-admin/edit.php?post_type=animal&tag[0]=funny&tag[1]=lovely

returns no posts.

But changing the query_var to somethings other than tag, e.g. tags, _tag when registering the taxonomy returns the right number of filtered posts e.g.

/wp-admin/edit.php?post_type=animal&_tag[0]=funny&_tag[1]=lovely

My intuition is that Wordpress is doing some shenanigans with my taxonomy, when queering posts.

So how can I make a custom taxonomy with the search query param 'tag' in URL work?

1 Answers
Related