Search code examples
wordpresscustom-post-typecustom-taxonomy

WordPress filtering custom taxonomies on custom post type


I've got two diffrent custom post types sharing the same custom taxonomy. I want the first custom post type to show al the entries from the custom taxonomy. The second custom post type has to filter out one entry and show al other custom taxonomies (based on ID perhaps).

Is this possible? I saw someone suggest using the post_edit_category_parent_dropdown_args filter but I don't see how I could use that to actually filter since it doesn't allow for ID's to be specified.

The only other solution I could think of was making another custom taxonomy, copying al the data except for the entry I want to be filtered out but this just seems messy :/

EDIT:

Thanks for the responses! I can't share screenshots but I've tried explaining it as best as I can below:

I have two custom post types, one named "vacancy" and another named "order" who share the same custom taxonomy named "location", there are 3 locations defined in the custom taxonomy. Let's say: "Netherlands", "Germany" and "France"

Now I want to be able to select al custom taxonomies when editing "vacancy" so: "Netherlands", "Germany" and "France". When editing "order" I want "Germany" to be hidden or greyed out so the only available options are "Germany" and "France"


Solution

  • I never did find a solution, we now have 2 custom taxonomy for the "location" taxonomy. :(