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 have a custom taxonomy X.

I've specified that the UI should be shown (for debugging purposes), however the UI is now interfering with my automation. I have code that automatically mirrors terms into this taxonomy, duplicating it. Taxonomy X is effectively a copy of Taxonomy Y or a subset. This code is working almost perfectly, except that my assignment code is doing its work which is then undone by the WordPress UI code setting the terms for the post from the metabox.

So how do I make the metabox showing Taxonomy X terms read only? AKA keep the metabox, but remove any save/edit/delete hooks attached to it?

edit: for reference, if show_ui is set to false in the registration of the taxonomy, and the UI for that tax is hidden, then everything works as expected. ( which itself is to be expected)

share|improve this question
    
Do you need the metabox? –  Bainternet Apr 17 '12 at 17:26
    
No but if things it would be useful for development purposes –  Tom J Nowell Apr 17 '12 at 21:00
    
Then try removeing just the metabox : remove_meta_box( 'tagsdiv-custom_taxonomy_id', 'post', 'side' ); –  Bainternet Apr 18 '12 at 8:40
    
But then how will I view the terms? I want the UI so I can see what's happening in my hidden taxonomy when I'm doing dev work, I just don't want WordPress to interfere with my own automation by attempting to set the object terms –  Tom J Nowell Apr 18 '12 at 10:12
add comment

1 Answer

up vote 1 down vote accepted

Like Bainternet suggested - remove_meta_box( 'tagsdiv-custom_taxonomy_id', 'post', 'side' ); to remove the default Metabox. If you want to still see the terms. Then re-register the metabox with your own custom callback.

This callback function can then mimic the function used to display the default metabox - but simply omitting any input forms /checkboxes which send any data.

The function you'll want to mimic is:

share|improve this answer
    
This is exactly what I wanted, and I learnt something new, thankyou =) –  Tom J Nowell Apr 18 '12 at 10:33
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.