Changeset 25572
- Timestamp:
- 09/23/2013 05:11:09 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-form-advanced.php
r25527 r25572 141 141 // all taxonomies 142 142 foreach ( get_object_taxonomies( $post ) as $tax_name ) { 143 $taxonomy = get_taxonomy( $tax_name);143 $taxonomy = get_taxonomy( $tax_name ); 144 144 if ( ! $taxonomy->show_ui ) 145 145 continue; … … 147 147 $label = $taxonomy->labels->name; 148 148 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; 151 151 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 ) ); 153 155 } 154 156 -
trunk/src/wp-includes/post.php
r25554 r25572 1140 1140 * - supports - An alias for calling add_post_type_support() directly. Defaults to title and editor. 1141 1141 * * See {@link add_post_type_support()} for documentation. 1142 * - register_meta_box_cb - Provide a callback function that will be called when setting up the1143 * meta boxesfor the edit form. Do remove_meta_box() and add_meta_box() calls in the callback.1142 * - register_meta_box_cb - Provide a callback function that sets up the meta boxes 1143 * for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback. 1144 1144 * - taxonomies - An array of taxonomy identifiers that will be registered for the post type. 1145 1145 * * Default is no taxonomies. -
trunk/src/wp-includes/taxonomy.php
r25553 r25572 290 290 * - show_tagcloud - Whether to list the taxonomy in the Tag Cloud Widget. 291 291 * * If not set, the default is inherited from show_ui. 292 * - meta_box_cb - Provide a callback function for the meta box display. Defaults to 293 * post_categories_meta_box for hierarchical taxonomies and post_tags_meta_box for non-hierarchical. 292 294 * - capabilities - Array of capabilities for this taxonomy. 293 295 * * You can see accepted values in this function. … … 333 335 'show_in_nav_menus' => null, 334 336 'show_tagcloud' => null, 337 'meta_box_cb' => null, 335 338 'capabilities' => array(), 336 339 'rewrite' => true, … … 401 404 $args['labels'] = get_taxonomy_labels( (object) $args ); 402 405 $args['label'] = $args['labels']->name; 406 407 // If not set, use the default meta box 408 if ( null === $args['meta_box_cb'] ) { 409 if ( $args['hierarchical'] ) 410 $args['meta_box_cb'] = 'post_categories_meta_box'; 411 else 412 $args['meta_box_cb'] = 'post_tags_meta_box'; 413 } 403 414 404 415 $wp_taxonomies[ $taxonomy ] = (object) $args;
Note: See TracChangeset
for help on using the changeset viewer.