Consolidate logic for not showing a taxonomy meta box. props ocean90. fixes #21543.

Built from https://develop.svn.wordpress.org/trunk@25953


git-svn-id: http://core.svn.wordpress.org/trunk@25912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2013-10-27 20:36:09 +00:00
parent a9d78889d7
commit 396582d836
1 changed files with 2 additions and 3 deletions

View File

@ -147,7 +147,7 @@ if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type,
// all taxonomies // all taxonomies
foreach ( get_object_taxonomies( $post ) as $tax_name ) { foreach ( get_object_taxonomies( $post ) as $tax_name ) {
$taxonomy = get_taxonomy( $tax_name ); $taxonomy = get_taxonomy( $tax_name );
if ( ! $taxonomy->show_ui ) if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb )
continue; continue;
$label = $taxonomy->labels->name; $label = $taxonomy->labels->name;
@ -157,8 +157,7 @@ foreach ( get_object_taxonomies( $post ) as $tax_name ) {
else else
$tax_meta_box_id = $tax_name . 'div'; $tax_meta_box_id = $tax_name . 'div';
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 ) );
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') ) if ( post_type_supports($post_type, 'page-attributes') )