WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/xmlrpc.php

    r14418 r15426  
    934934        );
    935935
    936         $cat_id = wp_insert_category($new_category);
    937         if ( !$cat_id )
     936        $cat_id = wp_insert_category($new_category, true);
     937        if ( is_wp_error( $cat_id ) ) {
     938            if ( 'term_exists' == $cat_id->get_error_code() )
     939                return (int) $cat_id->get_error_data();
     940            else
     941                return(new IXR_Error(500, __("Sorry, the new category failed.")));
     942        } elseif ( ! $cat_id ) {
    938943            return(new IXR_Error(500, __("Sorry, the new category failed.")));
     944        }
    939945
    940946        return($cat_id);
Note: See TracChangeset for help on using the changeset viewer.