Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to prevent people from adding terms to some, but not all of my taxonomies. There are four taxonomies in a certain post type. I need to prevent people from adding to two of those.

I used jQuery to prevent people from adding them on the taxonomy page, but I'm having trouble with the new post/edit post page.

I can't just hide the box, because I need them to be able to search and select from existing items.

I don't know if jQuery will do the trick, because I'd like that input box to still be available for searching for existing terms.

So, does anyone know if this is possible?

share|improve this question
add comment

2 Answers 2

up vote 0 down vote accepted

For these situations build your own metabox for the tax terms and use radio or select.

My fork of Jared Atchison's Custom Meta Box class supports custom taxonomy metaboxes.

After you get the metabox directory uploaded use this to create your meta box.

$prefix = 'xxx_';  //Add your own unique prefix.
$meta_boxes = array();
$meta_boxes[] = array(
    'id' => 'test_metabox',
    'title' => 'Test Metabox',
    'pages' => array('page'), // post type
    'context' => 'normal',
    'priority' => 'high',
    'show_names' => true, // Show field names on the left
    'fields' => array(
          array(
           'name' => 'Test Taxonomy Radio',
           'desc' => 'Description Goes Here',
           'id' => $prefix.'text_taxonomy_radio',
           'taxonomy' => '', //Enter Taxonomy Slug
           'type' => 'taxonomy-radio',  
        ),
    );

require_once('metabox/init.php');
share|improve this answer
add comment

I believe the Role Scoper plugin will work for you here.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.