Make WordPress Core

Ticket #10437: 10437.diff

File 10437.diff, 2.4 KB (added by scribu, 15 years ago)

add show_box parameter

  • wp-includes/taxonomy.php

     
    190190 * public - If the taxonomy should be publically queryable; //@TODO not implemented.
    191191 * defaults to true.
    192192 *
    193  * show_ui - If the WordPress UI admin tags UI should apply to this taxonomy;
     193 * show_ui - If a standard administration screen should be shown for this taxonomy;
    194194 * defaults to public.
    195195 *
     196 * show_box - If a standard metabox should be shown for this taxonomy;
     197 * defaults to public.
     198 *
    196199 * show_tagcloud - false to prevent the taxonomy being listed in the Tag Cloud Widget;
    197  * defaults to show_ui which defalts to public.
     200 * defaults to public.
    198201 *
    199202 * @package WordPress
    200203 * @subpackage Taxonomy
     
    219222                                                'query_var' => $taxonomy,
    220223                                                'public' => true,
    221224                                                'show_ui' => null,
     225                                                'show_box' => null,
    222226                                                'label' => null,
    223227                                                'show_tagcloud' => null,
    224228                                                '_builtin' => false
     
    244248        if ( is_null($args['show_ui']) )
    245249                $args['show_ui'] = $args['public'];
    246250
     251        if ( is_null($args['show_box']) )
     252                $args['show_box'] = $args['public'];
     253
    247254        if ( is_null($args['show_tagcloud']) )
    248                 $args['show_tagcloud'] = $args['show_ui'];
     255                $args['show_tagcloud'] = $args['public'];
    249256
    250257        if ( is_null($args['label'] ) )
    251258                $args['label'] = $taxonomy;
  • wp-admin/edit-form-advanced.php

     
    9797        $taxonomy = get_taxonomy($tax_name);
    9898        $label = isset($taxonomy->label) ? esc_attr($taxonomy->label) : $tax_name;
    9999
    100         if ( !is_taxonomy_hierarchical($tax_name) )
    101                 add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', $post_type, 'side', 'core');
    102         else
    103                 add_meta_box($tax_name . 'div', $label, 'post_categories_meta_box', $post_type, 'side', 'core', array( 'taxonomy' => $tax_name ));
     100        if ( $taxonomy->show_box ) {
     101                if ( !is_taxonomy_hierarchical($tax_name) )
     102                        add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', $post_type, 'side', 'core');
     103                else
     104                        add_meta_box($tax_name . 'div', $label, 'post_categories_meta_box', $post_type, 'side', 'core', array( 'taxonomy' => $tax_name ));
     105        }
    104106}
    105107
    106108if ( post_type_supports($post_type, 'page-attributes') )