I was wondering if someone can help me with this. I'm currently following Shibashake's tu开发者_StackOverflow社区torial 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?
Found the answer asking over at the Wordpress side of StackExchange: For taxonomies that work like tags, you use "tagsdiv-slug". But for ones that are hierarchical, you use "slugdiv". The answe can be found here: Thanks to @Jan Fabry for his answer
精彩评论