Make WordPress Core

Changeset 25948


Ignore:
Timestamp:
10/27/2013 04:28:19 PM (11 years ago)
Author:
helen
Message:

Allow passing false for the meta_box_cb arg in register_taxonomy() to turn off the meta box display entirely. fixes #21543.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r25868 r25948  
    158158        $tax_meta_box_id = $tax_name . 'div';
    159159
    160     add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) );
     160    if ( false !== $taxonomy->meta_box_cb )
     161        add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) );
    161162}
    162163
  • trunk/src/wp-includes/taxonomy.php

    r25933 r25948  
    290290 * - show_tagcloud - Whether to list the taxonomy in the Tag Cloud Widget.
    291291 *     * 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 * - meta_box_cb - Provide a callback function for the meta box display.
     293 *     * If not set, defaults to post_categories_meta_box for hierarchical taxonomies
     294 *     and post_tags_meta_box for non-hierarchical.
     295 *     * If false, no meta box is shown.
    294296 * - capabilities - Array of capabilities for this taxonomy.
    295297 *     * You can see accepted values in this function.
Note: See TracChangeset for help on using the changeset viewer.