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 was wondering if someone can help me with this. I'm currently following Shibashake's tutorial about creating custom meta-boxes that include taxonomy selection here: http://shibashake.com/wordpress-theme/wordpress-custom-taxonomy-input-panels . They show how to remove the standard metabox Wordpress automatically creates for taxonomies using the remove_meta_box function. Only problem is that the function for some reason doesn't seem to work on taxonomies that work as categories ie ones where the hierarchical option is set to true. I know I have the function working because the ones set up as tags disappear easily enough. I can't if it just isn't possible or if there is something special I need to add in one of the parameters to make it work.

Example:

$args = array( 
    'hierarchical' => false,  
    'label' =>'People',  
    'query_var' => true,  
    'rewrite' => true       
);
register_taxonomy('people', 'post',$args);

remove_meta_box('tagsdiv-people','post','side');

That works fine. If I set hierarchical to 'true, however, the meta box stays put.

Can anyone shed some light?

share|improve this question
    
wow, thanks. All it does is add a 'div' to the end of the taxonomy slug. For example, if the taxonomy's slug was 'people', the name of the metabox would be called 'peoplediv'. Works like a charm. You should have posted this as an answer. –  Manny Fleurmond Jan 1 '11 at 2:50
add comment

1 Answer

up vote 6 down vote accepted

Non-hierarchical taxonomies (like tags) use tagsdiv-{$tax_name}. Hierarchical taxonomies (like categories) use {$tax_name}div.

This is for historical reasons: categories were placed in categorydiv, tags in tagsdiv. When support for multiple non-hierarchical taxonomies was added, the tagsdiv name was expanded to tagsdiv-{$tax_name}. When finally multiple hierarchical taxonomies were made possible, they choose to generalize categorydiv to {$tax_name}div.

share|improve this answer
    
I once again thank you, @Jan. –  Manny Fleurmond Jan 1 '11 at 15:22
1  
It was a fun thing to research where the difference came from. And welcome to the site @Manny, I hope we'll see more good questions and answers from you! –  Jan Fabry Jan 2 '11 at 0:06
    
Thanks. I hope I can get to the point where I give good answers myself. I already love how friendly this community is and how much I can learn from others' questions. –  Manny Fleurmond Jan 2 '11 at 2:26
    
@MannyFleurmond & Jan : great Q&A and comment exchange - just checked and it was Manny 2nd question in the site, a toast is needed: beers for all and cheers both :) –  brasofilo May 31 '12 at 20:39
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.