Changeset 12833 for trunk/wp-includes/taxonomy.php
- Timestamp:
- 01/26/2010 11:32:04 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/taxonomy.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r12818 r12833 16 16 */ 17 17 function create_initial_taxonomies() { 18 register_taxonomy( 'category', 'post', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ; 19 register_taxonomy( 'post_tag', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags'), 'query_var' => false, 'rewrite' => false) ) ; 20 register_taxonomy( 'link_category', 'link', array('hierarchical' => false, 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ; 18 register_taxonomy( 'category', 'post', array( 'hierarchical' => true, 19 'update_count_callback' => '_update_post_term_count', 20 'label' => __('Categories'), 21 'query_var' => false, 22 'rewrite' => false, 23 'edit_cap' => 'no_priv' 24 ) ) ; 25 26 register_taxonomy( 'post_tag', 'post', array( 27 'hierarchical' => false, 28 'update_count_callback' => '_update_post_term_count', 29 'label' => __('Post Tags'), 30 'query_var' => false, 31 'rewrite' => false 32 ) ) ; 33 34 register_taxonomy( 'link_category', 'link', array( 'hierarchical' => false, 35 'label' => __('Categories'), 36 'query_var' => false, 37 'rewrite' => false 38 ) ) ; 21 39 } 22 40 add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority … … 168 186 global $wp_taxonomies, $wp_rewrite, $wp; 169 187 170 if ( !is_array($wp_taxonomies))188 if ( ! is_array($wp_taxonomies) ) 171 189 $wp_taxonomies = array(); 172 190 … … 190 208 $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=$term"); 191 209 $wp_rewrite->add_permastruct($taxonomy, "/{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']); 210 } 211 212 foreach ( array('manage_cap', 'edit_cap', 'delete_cap') as $cap ) { 213 if ( empty($args[$cap]) ) 214 $args[$cap] = 'manage_categories'; 192 215 } 193 216
Note: See TracChangeset
for help on using the changeset viewer.