Make WordPress Core


Ignore:
Timestamp:
09/23/2013 05:11:09 PM (12 years ago)
Author:
nacin
Message:

Introduce a meta_box_cb argument for register_taxonomy().

The specified callback function is used as the meta box callback for the taxonomy.

props garyc40, helen.
fixes #14206.

File:
1 edited

Legend:

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

    r25527 r25572  
    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;
     
    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_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) );
    153155}
    154156
Note: See TracChangeset for help on using the changeset viewer.