Allow localized commas to be used as tag separators. see #7897.

git-svn-id: https://develop.svn.wordpress.org/trunk@19853 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2012-02-07 18:06:12 +00:00
parent 7391c909df
commit 092808ead8
9 changed files with 59 additions and 26 deletions
+6 -1
View File
@@ -2907,7 +2907,12 @@ function wp_set_post_terms( $post_id = 0, $tags = '', $taxonomy = 'post_tag', $a
if ( empty($tags) )
$tags = array();
$tags = is_array($tags) ? $tags : explode( ',', trim($tags, " \n\t\r\0\x0B,") );
if ( ! is_array( $tags ) ) {
$comma = _x( ',', 'tag delimiter' );
if ( ',' !== $comma )
$tags = str_replace( $comma, ',', $tags );
$tags = explode( ',', trim( $tags, " \n\t\r\0\x0B," ) );
}
// Hierarchical taxonomies must always pass IDs rather than names so that children with the same
// names but different parents aren't confused.