我会这样做:
$add_action(\'add_meta_boxes_my_posttype\', \'my_add_meta_boxes\');
function my_add_meta_boxes ($post) {
$taxoms = array(\'my_taxonomy\', \'my_second_taxonomy\');
foreach ( get_object_taxonomies( $post ) as $tax_name ) {
if( !in_array($tax_name, $taxoms) ) continue;
$taxonomy = get_taxonomy($tax_name);
if ( ! $taxonomy->show_ui )
continue;
$label = $taxonomy->labels->name;
if ( !is_taxonomy_hierarchical($tax_name) ) {
add_meta_box($tax_name . \'div\', $label, \'post_categories_meta_box\', null, \'side\', \'core\', array( \'taxonomy\' => $tax_name ));
remove_meta_box(\'tagsdiv-\' . $tax_name, null, \'side\');
}
}
}
之后,由您来隐藏窗体的父选择框