WordPress.org

Make WordPress Core

Changeset 10965


Ignore:
Timestamp:
04/16/09 23:17:49 (5 years ago)
Author:
ryan
Message:

Create default taxonomies upon init. Props nbachiyski. fixes #9399

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r10963 r10965  
    1818 */ 
    1919$wp_taxonomies = array(); 
    20 $wp_taxonomies['category'] = (object) array('name' => 'category', 'object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories')); 
    21 $wp_taxonomies['post_tag'] = (object) array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags')); 
    22 $wp_taxonomies['link_category'] = (object) array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false); 
     20 
     21function 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} 
     28add_action( 'init', 'create_initial_taxonomies' ); 
    2329 
    2430/** 
Note: See TracChangeset for help on using the changeset viewer.