From 5cb5750259c9c6711dee574ab37ea765c65640bf Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 19 Dec 2007 23:25:11 +0000 Subject: [PATCH] Don't create blank terms. Props ionfish and jhodgdon. fixes #5494 git-svn-id: http://svn.automattic.com/wordpress/trunk@6424 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 6131f6fba..416c7a9f0 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1205,6 +1205,9 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) { $term_ids = array(); foreach ($terms as $term) { + if ( !strlen(trim($term)) ) + continue; + if ( !$id = is_term($term, $taxonomy) ) $id = wp_insert_term($term, $taxonomy); if ( is_wp_error($id) )