WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/22/10 19:30:05 (4 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r12789 r12798  
    9595// all tag-style taxonomies 
    9696foreach ( get_object_taxonomies($post_type) as $tax_name ) { 
    97     if ( !is_taxonomy_hierarchical($tax_name) ) { 
    98         $taxonomy = get_taxonomy($tax_name); 
    99         $label = isset($taxonomy->label) ? esc_attr($taxonomy->label) : $tax_name; 
    100  
     97    $taxonomy = get_taxonomy($tax_name); 
     98    $label = isset($taxonomy->label) ? esc_attr($taxonomy->label) : $tax_name; 
     99 
     100    if ( !is_taxonomy_hierarchical($tax_name) ) 
    101101        add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', $post_type, 'side', 'core'); 
    102     } 
     102    else 
     103        add_meta_box($tax_name.'div', $label, 'post_categories_meta_box', 'post', 'side', 'core', array( 'taxonomy' => $tax_name )); 
    103104} 
    104  
    105 if ( is_object_in_taxonomy($post_type, 'category') ) 
    106     add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', $post_type, 'side', 'core'); 
    107105 
    108106if ( post_type_supports($post_type, 'page-attributes') ) 
Note: See TracChangeset for help on using the changeset viewer.