mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user