I’m trying to create a permalink pattern for a Custom Type, that includes one of its taxonomies. The taxonomy name is known from the start (so I’m not trying to add or mix all of its taxonomies, just a specific one), but the value will by dynamic, of course.
Normally, the Custom Type permalink is built using the rewrite
arg with the slug
param, but I don’t see how I could add a dynamic variable in there.
http://codex.wordpress.org/Function_Reference/register_post_type
I’m guessing a custom solution is required, but I’m not sure what the best unintrusive approach would be.
Is there a known practice for this or has anyone built something similar recently? I’m using WP 3.2.1 btw.
After more searching I managed to create fairly elegant solution using the
custom_post_link
filter.Let’s say you have a
project
Custom Type with aclient
Taxonomy. Add this hook:Then, when registering the Custom Type, set the
rewrite
arg like this:I guess I should have dug deeper before asking, but at least we have a complete solution now.