I’m creating a custom taxonomy whose terms must remain fixed by all users. Once I’ve set up the starting set of terms, I want them to be immutable. I also don’t want to clutter up the Admin UI with additional links and metaboxes where they’re not needed.
However, setting public => 'false'
, or show_ui => 'false'
not only hides the manage tax link, but also prevents the user from assigning the term to a new post.
I need a way to hide the “manage” link within the post type pulldown, show the term selector metabox on the post page, but (hopefully) disable the “Add Term” option at the bottom of this metabox.
Does such a feature exist? Or are taxonomies always supposed to be user editable?
Custom taxonomy capabilities get me most of the way there, since you can independently set CRUD rights based on capability. But how to disable even admins from modification? (I know this sounds like a bad idea but it’s viable.)
A bit late but thought this could use updating.
Create your custom taxonomy and add the terms you need, then go back to your
register_taxonomy()
function and set thecapabilities
argument (which itself accepts an array of capabilities). You can see how I setup sex for dogs which can only ever have two valuesâ”Male” or “Female”, which I input. Now admins can only assign a dog to a sex but cannot add, delete, or edit the sexes.Works on hierarchical taxonomies; I did not try non-hierarchical but it should work there too.
You talking categories (hierarchical) or tags? You just need a hidden taxonomy + custom widget. If it’s categories, it easier to do, if tags… depends if the number of items is decent. And you can hide them from public view only for non-Administrators. That way you can manage them easily while the others can’t touch them.
Thanks.