Make WordPress Core

Ticket #14206: 14206.diff

File 14206.diff, 1.8 KB (added by wonderboymusic, 13 years ago)
  • wp-admin/edit-form-advanced.php

    diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
    index e656dd5..cfc2698 100644
    a b if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 
    140140
    141141// all taxonomies
    142142foreach ( get_object_taxonomies( $post ) as $tax_name ) {
    143         $taxonomy = get_taxonomy($tax_name);
     143        $taxonomy = get_taxonomy( $tax_name );
    144144        if ( ! $taxonomy->show_ui )
    145145                continue;
    146146
    147147        $label = $taxonomy->labels->name;
    148148
    149         if ( !is_taxonomy_hierarchical($tax_name) )
    150                 add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', null, 'side', 'core', array( 'taxonomy' => $tax_name ));
     149        if ( ! is_taxonomy_hierarchical( $tax_name ) )
     150                $tax_meta_box_id = 'tagsdiv-' . $tax_name;
    151151        else
    152                 add_meta_box($tax_name . 'div', $label, 'post_categories_meta_box', null, 'side', 'core', array( 'taxonomy' => $tax_name ));
     152                $tax_meta_box_id = $tax_name . 'div';
     153
     154        add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_callback, null, 'side', 'core', array( 'taxonomy' => $tax_name ) );
    153155}
    154156
    155157if ( post_type_supports($post_type, 'page-attributes') )
  • wp-includes/taxonomy.php

    diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
    index 955369e..1a8ef4f 100644
    a b function register_taxonomy( $taxonomy, $object_type, $args = array() ) { 
    388388        $args['labels'] = get_taxonomy_labels( (object) $args );
    389389        $args['label'] = $args['labels']->name;
    390390
     391        if ( empty( $args['meta_box_callback'] ) ) {
     392                if ( $args['hierarchical'] ) {
     393                        $args['meta_box_callback'] = 'post_categories_meta_box';
     394                } else {
     395                        $args['meta_box_callback'] = 'post_tags_meta_box';
     396                }
     397        }
     398
    391399        $wp_taxonomies[$taxonomy] = (object) $args;
    392400
    393401        // register callback handling for metabox