Taxonomies, restrict editing and creation of terms?

Can I stop my client from adding terms to a certain taxonomy? So that I set up a fixed amount of terms, and that´s what they get to choose from.

Can I remove the menu item for certain taxonomies in the backend? Let´s say I have created two taxonomies, and I want the user to be able to access one of them and the other should be hidden and only show up as options in the editing of posts/pages.

Related posts

Leave a Reply

1 comment

  1. When you registered the taxonomy with register_taxonomy there is a capabilities argument. This takes, an array of the capabilities for this taxonomy. In particular:

    • ‘manage_terms’
    • ‘edit_terms’
    • ‘delete_terms’
    • ‘assign_terms’

    Associated with each of them should be a capability that it is required to be able to perform that action. For instance to assign_terms usually requires the user to have the capabiliy of edit_posts. You can give the first three some capability (custom or otherwise, manage_options might do) that your clients do not have, but you do. The last can be just edit_posts.

    As an example:

     register_taxonomy('mytax',array('post'), array(
       'hierarchical' => false,
       //Other properties...
       'capabilities'=>array(
            'manage_terms' => 'manage_options',//or some other capability your clients don't have
            'edit_terms' => 'manage_options',
            'delete_terms' => 'manage_options',
            'assign_terms' =>'edit_posts'),
       //Other properties...
        ));