From 7fa704d972b6723717b4d8053693f97b6f81aad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Sun, 27 Oct 2013 16:29:09 +0000 Subject: [PATCH] Allow passing `false` for the `meta_box_cb` arg in `register_taxonomy()` to turn off the meta box display entirely. fixes #21543. Built from https://develop.svn.wordpress.org/trunk@25948 git-svn-id: http://core.svn.wordpress.org/trunk@25907 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-advanced.php | 3 ++- wp-includes/taxonomy.php | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index dab3f84e5e..b2fff6e851 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -157,7 +157,8 @@ foreach ( get_object_taxonomies( $post ) as $tax_name ) { else $tax_meta_box_id = $tax_name . 'div'; - add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) ); + if ( false !== $taxonomy->meta_box_cb ) + add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) ); } if ( post_type_supports($post_type, 'page-attributes') ) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 4bf48a93d6..258f7924dc 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -289,8 +289,10 @@ function is_taxonomy_hierarchical($taxonomy) { * * If not set, the default is inherited from public. * - show_tagcloud - Whether to list the taxonomy in the Tag Cloud Widget. * * If not set, the default is inherited from show_ui. - * - meta_box_cb - Provide a callback function for the meta box display. Defaults to - * post_categories_meta_box for hierarchical taxonomies and post_tags_meta_box for non-hierarchical. + * - meta_box_cb - Provide a callback function for the meta box display. + * * If not set, defaults to post_categories_meta_box for hierarchical taxonomies + * and post_tags_meta_box for non-hierarchical. + * * If false, no meta box is shown. * - capabilities - Array of capabilities for this taxonomy. * * You can see accepted values in this function. * - rewrite - Triggers the handling of rewrites for this taxonomy. Defaults to true, using $taxonomy as slug.