Disable any modification of taxonomies
-
Hello guys,
i try to make a new posttype (success) with one registered taxonomy (success). This taxonomy is called Gender and should therefore contain only “male” and “female” which i add via PHP instantly after the taxonomy-registration.
To avoid any changes of my taxonomy (additional terms) I set all capabilities to “noone” so not even an administrator may change or add any term in this taxonomy.I experienced in my following tests that anyone who can edit/write a post may insert new terms into my taxonomy – maybe by accident or on purpose, doesn’t matter.
So all i want is to eliminate this functionallity with this posttype. I am searching for a hook where i can prevent inserting a new taxonomy or one which is called when the term was inserted (i don’t have any problems with removing it after it was inserted if it doesn’t match my conditions).
Yet i tried out following hooks: create_category, save_post, edit_post. but none will work. For testing reasons i tried debugging in my function with adding
add_action(‘admin_notices’, ‘echo “….”;’);
to it. But after saving a post, nothing is printed out. So i guess i picked the wrong hooks.May anyone know a solution?
Another question which would solve my primary problem would be how to provide a drop-down menu for picking this specific taxonomy? Would prevent user-generated-input and therefore new terms in my taxonomy.
If anyone wants to know why i need this: my plugin should allow too many (in my opinion) people to create posts. So i try to minimize possible errors, as always – do not allow anything not specifically needed by the DAU.
Thanks a lot.
- The topic ‘Disable any modification of taxonomies’ is closed to new replies.