I have a (hopefully simple) question here.
Built in post type: Category
I have a custom post type: Rights, with a custom Category taxonomy for it (Rights Category).
My issue is using the rewrite slug of rights/category
is being caught first by the generic category
rewrite rule. So I am currently stuck using rights-category
, or rights/categories
(at least a little more elegant).
Is there any way (besides changing the Category base) to essentially say "Prioritize my custom rewrite rule over the built-in ones"? Last time I looked at Category's registration, I didn't think it was possible to register your own taxonomies before the built-in ones (priority 0), therefore placing your own rewrite rules ahead of WP Core's.
Note: I am defining the custom taxonomy and post type within mu-plugins. I also just tried using a priority of 0, and 1, and they seem to work with no repercussions. I'd still like some validation on this, however.
register_post_type('right', $args)
where$args['has_archive'] = 'rights'
. If you use plural cpt name only chance is add a custom rewrite rule, in that case see @cybnet answer. You can do registration for cpt, taxonomy and rewrite rule in same function, hooked on init (priority is not a important)./category/*
is being searched for before/rights/category/*
is, in the order of the global$wp_rewrite
.init
action is set to priority 1. So yes, this is correct, and what I mention above in my question. Want to move that to an answer so I can mark this complete?