Make WordPress Core


Ignore:
Timestamp:
01/11/2010 07:27:44 PM (17 years ago)
Author:
ryan
Message:

Show custom hierarchical taxonomies in the menus. Props dd32. see #11838

File:
1 edited

Legend:

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

    r12662 r12694  
    109109 */
    110110function wp_insert_category($catarr, $wp_error = false) {
    111         $cat_defaults = array('cat_ID' => 0, 'cat_name' => '', 'category_description' => '', 'category_nicename' => '', 'category_parent' => '');
     111        $cat_defaults = array('cat_ID' => 0, 'taxonomy' => 'category', 'cat_name' => '', 'category_description' => '', 'category_nicename' => '', 'category_parent' => '');
    112112        $catarr = wp_parse_args($catarr, $cat_defaults);
    113113        extract($catarr, EXTR_SKIP);
    … …  
    143143
    144144        if ( $update )
    145                 $cat_ID = wp_update_term($cat_ID, 'category', $args);
     145                $cat_ID = wp_update_term($cat_ID, $taxonomy, $args);
    146146        else
    147                 $cat_ID = wp_insert_term($cat_name, 'category', $args);
     147                $cat_ID = wp_insert_term($cat_name, $taxonomy, $args);
    148148
    149149        if ( is_wp_error($cat_ID) ) {
Note: See TracChangeset for help on using the changeset viewer.