Don't create empty tags. Fixes #5412 props ionfish
git-svn-id: https://develop.svn.wordpress.org/trunk@6407 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f9a1eaf440
commit
5c75f4cc75
|
@ -1187,7 +1187,7 @@ function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) {
|
||||||
|
|
||||||
if ( empty($tags) )
|
if ( empty($tags) )
|
||||||
$tags = array();
|
$tags = array();
|
||||||
$tags = (is_array($tags)) ? $tags : explode( ',', $tags );
|
$tags = (is_array($tags)) ? $tags : explode( ',', trim($tags, " \s\n\t\r\0\x0B,") );
|
||||||
wp_set_object_terms($post_id, $tags, 'post_tag', $append);
|
wp_set_object_terms($post_id, $tags, 'post_tag', $append);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue