I have registered my custom taxonomy and want to use dropdown in back end... code given here Taxonomy dropdown metabox in the back-end works like a charm.... but now in admin there are two metaboxes one is my custom which shows as drop down and another is default which takes comma seprated input similar as tags and i dont want that... So how could i remove that default meta box...
3 Answers
I had the same question.
You use the remove_meta_box
functions mentioned in a previous answer, but you have two options: tagsdiv-{$tax_name}
for non-hierarchical taxonomies and {$tax_name}div
for hierarchical taxonomies (like categories). So in your case:
remove_meta_box('tagsdiv-brands', 'post', 'normal');
remove_meta_box('brandsdiv', 'post', 'normal');
use remove_meta_box. you may need to look at the html source to verify that the div that you want to hide is called tagsdiv-brands
, I'm pretty certain it should be correct.
function rajeev_remove_post_items() {
remove_meta_box('tagsdiv-brands', 'post', 'normal');
}
add_action('admin_menu', 'rajeev_remove_post_items' );
EDIT - I changed the function name from remove_post_items
to rajeev_remove_post_items
, it's always a good idea to prefix your functions with something likely to be unique to avoid potential collisions.