Create metaboxes for hierarchical taxonomies. Props prettyboymp. fixes #10122

git-svn-id: https://develop.svn.wordpress.org/trunk@12798 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-01-22 19:30:05 +00:00
parent 8f1e29abd1
commit e5a67cebd5
17 changed files with 268 additions and 194 deletions
+5 -7
View File
@@ -94,17 +94,15 @@ add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', $post_type, 'si
// all tag-style taxonomies
foreach ( get_object_taxonomies($post_type) as $tax_name ) {
if ( !is_taxonomy_hierarchical($tax_name) ) {
$taxonomy = get_taxonomy($tax_name);
$label = isset($taxonomy->label) ? esc_attr($taxonomy->label) : $tax_name;
$taxonomy = get_taxonomy($tax_name);
$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', 'side', 'core', array( 'taxonomy' => $tax_name ));
}
if ( is_object_in_taxonomy($post_type, 'category') )
add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', $post_type, 'side', 'core');
if ( post_type_supports($post_type, 'page-attributes') )
add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', $post_type, 'side', 'core');