From 6edc7aed5cbcb1e8a2e325f16b280a18c71afd02 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 18 Oct 2007 15:55:15 +0000 Subject: [PATCH] Catch WP_Error. Props tellyworth. fixes #5226 git-svn-id: http://svn.automattic.com/wordpress/trunk@6271 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 2935a20ba9..1167353767 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1119,6 +1119,8 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) { foreach ($terms as $term) { if ( !$id = is_term($term, $taxonomy) ) $id = wp_insert_term($term, $taxonomy); + if ( is_wp_error($id) ) + return $id; $term_ids[] = $id['term_id']; $id = $id['term_taxonomy_id']; $tt_ids[] = $id;