Make WordPress Core


Ignore:
Timestamp:
11/12/2007 07:12:49 PM (19 years ago)
Author:
ryan
Message:

Output WP_Error message when adding categories via AJAX. fixes #5342

File:
1 edited

Legend:

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

    r6157 r6329  
    5353}
    5454
    55 function wp_insert_category($catarr) {
     55function wp_insert_category($catarr, $wp_error = false) {
    5656        global $wpdb;
    5757
    … …  
    8585                $cat_ID = wp_insert_term($cat_name, 'category', $args);
    8686
    87         if ( is_wp_error($cat_ID) )
    88                 return 0;
     87        if ( is_wp_error($cat_ID) ) {
     88                if ( $wp_error )
     89                        return $cat_ID;
     90                else
     91                        return 0;
     92        }
    8993
    9094        return $cat_ID['term_id'];
Note: See TracChangeset for help on using the changeset viewer.