From 312438ad06219a146c38aebe284547f41ec94f4f Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 2 Apr 2010 01:23:58 +0000 Subject: [PATCH] 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 --- wp-admin/edit-form-advanced.php | 8 +++++++- wp-includes/taxonomy.php | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 0aedbbc7b5..1dd2dcbfde 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -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') ) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 65b1cf00c9..36b037eca6 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -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'); } /**