Use the taxonomy show_ui flag to control if all WordPress generated UI is exposed (Menu previously, This affects metaboxes). See #10437

git-svn-id: https://develop.svn.wordpress.org/trunk@13924 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-04-02 01:23:58 +00:00
parent f09e81941e
commit 312438ad06
2 changed files with 7 additions and 4 deletions

View File

@ -92,15 +92,21 @@ require_once('includes/meta-boxes.php');
add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', $post_type, 'side', 'core');
// all tag-style taxonomies
// all taxonomies
foreach ( get_object_taxonomies($post_type) as $tax_name ) {
$taxonomy = get_taxonomy($tax_name);
if ( ! $taxonomy->show_ui )
continue;
$label = isset($taxonomy->label) ? esc_attr($taxonomy->label) : $tax_name;
if ( !is_taxonomy_hierarchical($tax_name) )
add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', $post_type, 'side', 'core');
else
add_meta_box($tax_name . 'div', $label, 'post_categories_meta_box', $post_type, 'side', 'core', array( 'taxonomy' => $tax_name ));
// register callback handling for metabox
add_filter('wp_ajax_add-' . $tax_name, '_wp_ajax_add_hierarchical_term');
}
if ( post_type_supports($post_type, 'page-attributes') )

View File

@ -294,9 +294,6 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
$args['name'] = $taxonomy;
$args['object_type'] = (array) $object_type;
$wp_taxonomies[$taxonomy] = (object) $args;
// register callback handling for metabox
add_filter('wp_ajax_add-'.$taxonomy, '_wp_ajax_add_hierarchical_term');
}
/**