1

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?

0

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');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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