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
This commit is contained in:
Helen Hou-Sandí 2013-10-27 16:29:09 +00:00
parent a59389fc06
commit 7fa704d972
2 changed files with 6 additions and 3 deletions

View File

@ -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') )

View File

@ -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.