diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php
index d68285c981..72a3be789e 100644
--- a/wp-admin/includes/post.php
+++ b/wp-admin/includes/post.php
@@ -302,10 +302,12 @@ function bulk_edit_posts( $post_data = null ) {
if ( empty($terms) )
continue;
if ( is_taxonomy_hierarchical( $tax_name ) ) {
- $tax_input[$tax_name] = array_map( 'absint', $terms );
+ $tax_input[ $tax_name ] = array_map( 'absint', $terms );
} else {
- $tax_input[$tax_name] = preg_replace( '/\s*,\s*/', ',', rtrim( trim($terms), ' ,' ) );
- $tax_input[$tax_name] = explode(',', $tax_input[$tax_name]);
+ $comma = _x( ',', 'tag delimiter' );
+ if ( ',' !== $comma )
+ $terms = str_replace( $comma, ',', $terms );
+ $tax_input[ $tax_name ] = explode( ',', trim( $terms, " \n\t\r\0\x0B," ) );
}
}
}
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index e9b6574bb2..b0865a9c0a 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -264,10 +264,13 @@ function get_inline_data($post) {
foreach ( $taxonomy_names as $taxonomy_name) {
$taxonomy = get_taxonomy( $taxonomy_name );
- if ( $taxonomy->hierarchical && $taxonomy->show_ui )
- echo '
' . implode( ',', wp_get_object_terms( $post->ID, $taxonomy_name, array('fields'=>'ids')) ) . '
';
- elseif ( $taxonomy->show_ui )
- echo '
' . esc_html( str_replace( ',', ', ', get_terms_to_edit($post->ID, $taxonomy_name) ) ) . '
';
+ if ( $taxonomy->hierarchical && $taxonomy->show_ui ) {
+ echo '
'
+ . implode( ',', wp_get_object_terms( $post->ID, $taxonomy_name, array( 'fields' => 'ids' ) ) ) . '
';
+ } elseif ( $taxonomy->show_ui ) {
+ echo '
'
+ . esc_html( str_replace( ',', ', ', get_terms_to_edit( $post->ID, $taxonomy_name ) ) ) . '
';
+ }
}
if ( !$post_type_object->hierarchical )
diff --git a/wp-admin/js/inline-edit-post.dev.js b/wp-admin/js/inline-edit-post.dev.js
index e73c4a0099..adebb4f5ab 100644
--- a/wp-admin/js/inline-edit-post.dev.js
+++ b/wp-admin/js/inline-edit-post.dev.js
@@ -117,7 +117,7 @@ inlineEditPost = {
if ( 'post' == type ) {
// support multi taxonomies?
tax = 'post_tag';
- $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+tax, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
+ $('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+tax, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } );
}
$('html, body').animate( { scrollTop: 0 }, 'fast' );
},
@@ -184,12 +184,16 @@ inlineEditPost = {
$('.tags_input', rowData).each(function(){
var terms = $(this).text(),
taxname = $(this).attr('id').replace('_' + id, ''),
- textarea = $('textarea.tax_input_' + taxname, editRow);
+ textarea = $('textarea.tax_input_' + taxname, editRow),
+ comma = inlineEditL10n.comma;
- if ( terms )
+ if ( terms ) {
+ if ( ',' !== comma )
+ terms = terms.replace(/,/g, comma);
textarea.val(terms);
+ }
- textarea.suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
+ textarea.suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } );
});
// handle the post status
diff --git a/wp-admin/js/post.dev.js b/wp-admin/js/post.dev.js
index dd038d8983..ac6aafb01e 100644
--- a/wp-admin/js/post.dev.js
+++ b/wp-admin/js/post.dev.js
@@ -15,11 +15,19 @@ function array_unique_noempty(a) {
tagBox = {
clean : function(tags) {
- return tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
+ var comma = postL10n.comma;
+ if ( ',' !== comma )
+ tags = tags.replace(new RegExp(comma, 'g'), ',');
+ tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
+ if ( ',' !== comma )
+ tags = tags.replace(/,/g, comma);
+ return tags;
},
parseTags : function(el) {
- var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'), thetags = taxbox.find('.the-tags'), current_tags = thetags.val().split(','), new_tags = [];
+ var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'),
+ thetags = taxbox.find('.the-tags'), comma = postL10n.comma,
+ current_tags = thetags.val().split(comma), new_tags = [];
delete current_tags[num];
$.each( current_tags, function(key, val) {
@@ -29,7 +37,7 @@ tagBox = {
}
});
- thetags.val( this.clean( new_tags.join(',') ) );
+ thetags.val( this.clean( new_tags.join(comma) ) );
this.quickClicks(taxbox);
return false;
@@ -46,7 +54,7 @@ tagBox = {
disabled = thetags.prop('disabled');
- current_tags = thetags.val().split(',');
+ current_tags = thetags.val().split(postL10n.comma);
tagchecklist.empty();
$.each( current_tags, function( key, val ) {
@@ -74,14 +82,17 @@ tagBox = {
flushTags : function(el, a, f) {
a = a || false;
- var text, tags = $('.the-tags', el), newtag = $('input.newtag', el), newtags;
+ var tags = $('.the-tags', el),
+ newtag = $('input.newtag', el),
+ comma = postL10n.comma,
+ newtags, text;
text = a ? $(a).text() : newtag.val();
tagsval = tags.val();
- newtags = tagsval ? tagsval + ',' + text : text;
+ newtags = tagsval ? tagsval + comma + text : text;
newtags = this.clean( newtags );
- newtags = array_unique_noempty( newtags.split(',') ).join(',');
+ newtags = array_unique_noempty( newtags.split(comma) ).join(comma);
tags.val(newtags);
this.quickClicks(el);
@@ -96,7 +107,7 @@ tagBox = {
get : function(id) {
var tax = id.substr(id.indexOf('-')+1);
- $.post(ajaxurl, {'action':'get-tagcloud','tax':tax}, function(r, stat) {
+ $.post(ajaxurl, {'action':'get-tagcloud', 'tax':tax}, function(r, stat) {
if ( 0 == r || 'success' != stat )
r = wpAjax.broken;
@@ -142,7 +153,7 @@ tagBox = {
}
}).each(function(){
var tax = $(this).closest('div.tagsdiv').attr('id');
- $(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: "," } );
+ $(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: postL10n.comma + ' ' } );
});
// save tags on post save/publish
diff --git a/wp-includes/post.php b/wp-includes/post.php
index 2bdd51ba1f..062b70a447 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -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.
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index 83cc09e7f2..3201e72f6e 100644
--- a/wp-includes/script-loader.php
+++ b/wp-includes/script-loader.php
@@ -330,7 +330,8 @@ function wp_default_scripts( &$scripts ) {
'publicSticky' => __('Public, Sticky'),
'password' => __('Password Protected'),
'privatelyPublished' => __('Privately Published'),
- 'published' => __('Published')
+ 'published' => __('Published'),
+ 'comma' => _x( ',', 'tag delimiter' ),
) );
$scripts->add( 'link', "/wp-admin/js/link$suffix.js", array('wp-lists', 'postbox'), false, 1 );
@@ -353,7 +354,8 @@ function wp_default_scripts( &$scripts ) {
$scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
'error' => __('Error while saving the changes.'),
'ntdeltitle' => __('Remove From Bulk Edit'),
- 'notitle' => __('(no title)')
+ 'notitle' => __('(no title)'),
+ 'comma' => _x( ',', 'tag delimiter' ),
) );
$scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), false, 1 );