Changeset 11122
- Timestamp:
- 04/29/2009 04:40:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r11115 r11122 13 13 14 14 /** 15 * Default Taxonomy Objects 16 * @since 2.3.0 17 * @global array $wp_taxonomies 18 */ 19 $wp_taxonomies = array(); 20 15 * Creates the initial taxonomies when 'init' action is fired. 16 */ 21 17 function create_initial_taxonomies() { 22 global $wp_taxonomies; 23 $wp_taxonomies['category'] = (object) array('name' => 'category', 'object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories')); 24 $wp_taxonomies['post_tag'] = (object) array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags')); 25 $wp_taxonomies['link_category'] = (object) array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false); 26 27 } 28 add_action( 'init', 'create_initial_taxonomies' ); 18 register_taxonomy( 'category', 'post', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories')) ) ; 19 register_taxonomy( 'post_tag', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags')) ) ; 20 register_taxonomy( 'link_category', 'link', array('hierarchical' => false) ) ; 21 } 22 add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority 29 23 30 24 /** … … 173 167 function register_taxonomy( $taxonomy, $object_type, $args = array() ) { 174 168 global $wp_taxonomies, $wp_rewrite, $wp; 169 170 if (!is_array($wp_taxonomies)) 171 $wp_taxonomies = array(); 172 173 if (isset($wp_taxonomies[$taxonomy])) 174 return; 175 175 176 176 $defaults = array('hierarchical' => false, 'update_count_callback' => '', 'rewrite' => true, 'query_var' => true);
Note: See TracChangeset
for help on using the changeset viewer.