mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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: http://svn.automattic.com/wordpress/trunk@13924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0c8fda014c
commit
44ae35ec09
@ -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') )
|
||||
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user