Make WordPress Core

Changeset 922 in tests for trunk/includes/factory.php


Ignore:
Timestamp:
07/19/2012 04:31:22 PM (13 years ago)
Author:
ryan
Message:

Don't fatal when wp_insert_term() returns WP_Error. Props kurtpayne. fixes #107

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/factory.php

    r883 r922  
    118118    function create_object( $args ) {
    119119        $term_id_pair = wp_insert_term( $args['name'], $args['taxonomy'], $args );
     120        if ( is_wp_error( $term_id_pair ) )
     121            return $term_id_pair;
    120122        return $term_id_pair['term_id'];
    121123    }
Note: See TracChangeset for help on using the changeset viewer.