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
This commit is contained in:
ryan 2007-12-19 23:25:11 +00:00
parent 99ed3ba7ce
commit 5cb5750259
1 changed files with 3 additions and 0 deletions

View File

@ -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) )