Make WordPress Core

Changeset 13216


Ignore:
Timestamp:
02/19/2010 10:21:29 AM (17 years ago)
Author:
dd32
Message:

First pass at giving taxonomies a show_ui param. See #10773

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/menu.php

    r13094 r13216  
    5858        $i = 15;
    5959        foreach ( $wp_taxonomies as $tax ) {
    60                 if ( ! in_array('post', (array) $tax->object_type, true) )
     60                if ( ! $tax->show_ui || ! in_array('post', (array) $tax->object_type, true) )
    6161                        continue;
    6262
     
    9595        $i = 15;
    9696        foreach ( $wp_taxonomies as $tax ) {
    97                 if ( ! in_array($ptype, (array) $tax->object_type, true) )
     97                if ( ! $tax->show_ui || ! in_array($ptype, (array) $tax->object_type, true) )
    9898                        continue;
    9999
  • trunk/wp-includes/taxonomy.php

    r13170 r13216  
    2121                                                                                                        'singular_label' => __('Category'),
    2222                                                                                                        'query_var' => false,
    23                                                                                                         'rewrite' => false
     23                                                                                                        'rewrite' => false,
     24                                                                                                        'public' => true,
     25                                                                                                        'show_ui' => true,
     26                                                                                                        '_builtin' => true
    2427                                                                                                ) ) ;
    2528
     
    3033                                                                                                        'singular_label' => __('Post Tag'),
    3134                                                                                                        'query_var' => false,
    32                                                                                                         'rewrite' => false
     35                                                                                                        'rewrite' => false,
     36                                                                                                        'public' => true,
     37                                                                                                        'show_ui' => true,
     38                                                                                                        '_builtin' => true
    3339                                                                                                ) ) ;
    3440
     
    3642                                                                                                                'label' => __('Categories'),
    3743                                                                                                                'query_var' => false,
    38                                                                                                                 'rewrite' => false
     44                                                                                                                'rewrite' => false,
     45                                                                                                                'public' => false,
     46                                                                                                                'show_ui' => false,
     47                                                                                                                '_builtin' => true,
    3948                                                                                                        ) ) ;
    4049}
     
    190199                $wp_taxonomies = array();
    191200
    192         $defaults = array('hierarchical' => false, 'update_count_callback' => '', 'rewrite' => true, 'query_var' => true);
     201        $defaults = array(      'hierarchical' => false,
     202                                                'update_count_callback' => '',
     203                                                'rewrite' => true,
     204                                                'query_var' => $taxonomy,
     205                                                'public' => true,
     206                                                'show_ui' => null,
     207                                                '_builtin' => false
     208                                                );
    193209        $args = wp_parse_args($args, $defaults);
    194210
     
    210226                $wp_rewrite->add_permastruct($taxonomy, "/{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
    211227        }
     228
     229        if ( is_null($args['show_ui']) )
     230                $args['show_ui'] = $args['public'];
    212231
    213232        foreach ( array('manage_cap', 'edit_cap', 'delete_cap') as $cap ) {
Note: See TracChangeset for help on using the changeset viewer.