I was searching through the forums, but I can only find slightly related issues.

This is my problem:

I’d like to assign some editors the capability to only add posts in a predefined term of a custom taxonomy.

I have made a taxonomy called events, which holds a list with events that are added by an admin. Certain users are only allowed to add posts using a single event, e.g. “Japan” or “Haiti”.

Anyone with a hint on how to tackle this? are there user management-plugins that have this kind of capabilities?

Regards,
Joost.

3 Answers
3

First hook the save_post action: http://codex.wordpress.org/Plugin_API/Action_Reference/save_post

Then check capabilities: You have docs on that right?

Then get_the_terms for the $post_id provided by save_post and the taxonomy you want to check. http://codex.wordpress.org/Function_Reference/get_the_terms

Then if they are using a term (see note below) they are not allowed to use either stop/delete the post, set a warning, or remove the term.

Note: a taxonomy is a list of terms that can be applied to a post. Example: the taxonomy “Nation” would contain terms like “Mexico”, “France”, and “India”

Leave a Reply

Your email address will not be published. Required fields are marked *