diff --git a/wp-admin/js/tags-box.js b/wp-admin/js/tags-box.js
index 7d7eee53f1..b4d1cec969 100644
--- a/wp-admin/js/tags-box.js
+++ b/wp-admin/js/tags-box.js
@@ -6,7 +6,7 @@
/* global ajaxurl, tagBox, array_unique_noempty */
( function( $ ) {
- var tagDelimiter = ( window.tagsSuggestL10n && window.tagsSuggestL10n.tagDelimiter ) || ',';
+ var tagDelimiter = wp.i18n._x( ',', 'tag delimiter' ) || ',';
/**
* Filters unique items and returns a new array.
@@ -164,7 +164,7 @@
*/
xbutton = $( '' );
/**
@@ -334,11 +334,11 @@
switch ( this.userAction ) {
case 'remove':
- message = window.tagsSuggestL10n.termRemoved;
+ message = wp.i18n.__( 'Term removed.' );
break;
case 'add':
- message = window.tagsSuggestL10n.termAdded;
+ message = wp.i18n.__( 'Term added.' );
break;
default:
diff --git a/wp-admin/js/tags-box.min.js b/wp-admin/js/tags-box.min.js
index 57a4c50a6b..e562fbb400 100644
--- a/wp-admin/js/tags-box.min.js
+++ b/wp-admin/js/tags-box.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-!function(r){var u=window.tagsSuggestL10n&&window.tagsSuggestL10n.tagDelimiter||",";window.array_unique_noempty=function(t){var a=[];return r.each(t,function(t,e){(e=r.trim(e))&&-1===r.inArray(e,a)&&a.push(e)}),a},window.tagBox={clean:function(t){return","!==u&&(t=t.replace(new RegExp(u,"g"),",")),t=t.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),","!==u&&(t=t.replace(/,/g,u)),t},parseTags:function(t){var e=t.id.split("-check-num-")[1],a=r(t).closest(".tagsdiv"),s=a.find(".the-tags"),i=s.val().split(u),n=[];return delete i[e],r.each(i,function(t,e){(e=r.trim(e))&&n.push(e)}),s.val(this.clean(n.join(u))),this.quickClicks(a),!1},quickClicks:function(t){var e,i,a=r(".the-tags",t),n=r(".tagchecklist",t),c=r(t).attr("id");a.length&&(i=a.prop("disabled"),e=a.val().split(u),n.empty(),r.each(e,function(t,e){var a,s;(e=r.trim(e))&&(a=r("
").text(e),i||((s=r('")).on("click keypress",function(t){"click"!==t.type&&13!==t.keyCode&&32!==t.keyCode||(13!==t.keyCode&&32!==t.keyCode||r(this).closest(".tagsdiv").find("input.newtag").focus(),tagBox.userAction="remove",tagBox.parseTags(this))}),a.prepend(" ").prepend(s)),n.append(a))}),tagBox.screenReadersMessage())},flushTags:function(t,e,a){var s,i,n,c=r(".the-tags",t),o=r("input.newtag",t);return void 0===(n=(e=e||!1)?r(e).text():o.val())||""===n||(i=(s=c.val())?s+u+n:n,i=this.clean(i),i=array_unique_noempty(i.split(u)).join(u),c.val(i),this.quickClicks(t),e||o.val(""),void 0===a&&o.focus()),!1},get:function(a){var s=a.substr(a.indexOf("-")+1);r.post(ajaxurl,{action:"get-tagcloud",tax:s},function(t,e){0!==t&&"success"==e&&(t=r(''+t+"
"),r("a",t).click(function(){return tagBox.userAction="add",tagBox.flushTags(r("#"+s),this),!1}),r("#"+a).after(t))})},userAction:"",screenReadersMessage:function(){var t;switch(this.userAction){case"remove":t=window.tagsSuggestL10n.termRemoved;break;case"add":t=window.tagsSuggestL10n.termAdded;break;default:return}window.wp.a11y.speak(t,"assertive")},init:function(){var t=r("div.ajaxtag");r(".tagsdiv").each(function(){tagBox.quickClicks(this)}),r(".tagadd",t).click(function(){tagBox.userAction="add",tagBox.flushTags(r(this).closest(".tagsdiv"))}),r("input.newtag",t).keypress(function(t){13==t.which&&(tagBox.userAction="add",tagBox.flushTags(r(this).closest(".tagsdiv")),t.preventDefault(),t.stopPropagation())}).each(function(t,e){r(e).wpTagsSuggest()}),r("#post").submit(function(){r("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),r(".tagcloud-link").click(function(){tagBox.get(r(this).attr("id")),r(this).attr("aria-expanded","true").unbind().click(function(){r(this).attr("aria-expanded","false"===r(this).attr("aria-expanded")?"true":"false").siblings(".the-tagcloud").toggle()})})}}}(jQuery);
\ No newline at end of file
+!function(r){var u=wp.i18n._x(",","tag delimiter")||",";window.array_unique_noempty=function(t){var a=[];return r.each(t,function(t,e){(e=r.trim(e))&&-1===r.inArray(e,a)&&a.push(e)}),a},window.tagBox={clean:function(t){return","!==u&&(t=t.replace(new RegExp(u,"g"),",")),t=t.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),","!==u&&(t=t.replace(/,/g,u)),t},parseTags:function(t){var e=t.id.split("-check-num-")[1],a=r(t).closest(".tagsdiv"),i=a.find(".the-tags"),n=i.val().split(u),s=[];return delete n[e],r.each(n,function(t,e){(e=r.trim(e))&&s.push(e)}),i.val(this.clean(s.join(u))),this.quickClicks(a),!1},quickClicks:function(t){var e,n,a=r(".the-tags",t),s=r(".tagchecklist",t),c=r(t).attr("id");a.length&&(n=a.prop("disabled"),e=a.val().split(u),s.empty(),r.each(e,function(t,e){var a,i;(e=r.trim(e))&&(a=r("").text(e),n||((i=r('")).on("click keypress",function(t){"click"!==t.type&&13!==t.keyCode&&32!==t.keyCode||(13!==t.keyCode&&32!==t.keyCode||r(this).closest(".tagsdiv").find("input.newtag").focus(),tagBox.userAction="remove",tagBox.parseTags(this))}),a.prepend(" ").prepend(i)),s.append(a))}),tagBox.screenReadersMessage())},flushTags:function(t,e,a){var i,n,s,c=r(".the-tags",t),o=r("input.newtag",t);return void 0===(s=(e=e||!1)?r(e).text():o.val())||""===s||(n=(i=c.val())?i+u+s:s,n=this.clean(n),n=array_unique_noempty(n.split(u)).join(u),c.val(n),this.quickClicks(t),e||o.val(""),void 0===a&&o.focus()),!1},get:function(a){var i=a.substr(a.indexOf("-")+1);r.post(ajaxurl,{action:"get-tagcloud",tax:i},function(t,e){0!==t&&"success"==e&&(t=r(''+t+"
"),r("a",t).click(function(){return tagBox.userAction="add",tagBox.flushTags(r("#"+i),this),!1}),r("#"+a).after(t))})},userAction:"",screenReadersMessage:function(){var t;switch(this.userAction){case"remove":t=wp.i18n.__("Term removed.");break;case"add":t=wp.i18n.__("Term added.");break;default:return}window.wp.a11y.speak(t,"assertive")},init:function(){var t=r("div.ajaxtag");r(".tagsdiv").each(function(){tagBox.quickClicks(this)}),r(".tagadd",t).click(function(){tagBox.userAction="add",tagBox.flushTags(r(this).closest(".tagsdiv"))}),r("input.newtag",t).keypress(function(t){13==t.which&&(tagBox.userAction="add",tagBox.flushTags(r(this).closest(".tagsdiv")),t.preventDefault(),t.stopPropagation())}).each(function(t,e){r(e).wpTagsSuggest()}),r("#post").submit(function(){r("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),r(".tagcloud-link").click(function(){tagBox.get(r(this).attr("id")),r(this).attr("aria-expanded","true").unbind().click(function(){r(this).attr("aria-expanded","false"===r(this).attr("aria-expanded")?"true":"false").siblings(".the-tagcloud").toggle()})})}}}(jQuery);
\ No newline at end of file
diff --git a/wp-admin/js/tags-suggest.js b/wp-admin/js/tags-suggest.js
index c5ccf16eaf..81c2612c84 100644
--- a/wp-admin/js/tags-suggest.js
+++ b/wp-admin/js/tags-suggest.js
@@ -4,12 +4,12 @@
* @output wp-admin/js/tags-suggest.js
*/
( function( $ ) {
- if ( typeof window.tagsSuggestL10n === 'undefined' || typeof window.uiAutocompleteL10n === 'undefined' ) {
+ if ( typeof window.uiAutocompleteL10n === 'undefined' ) {
return;
}
var tempID = 0;
- var separator = window.tagsSuggestL10n.tagDelimiter || ',';
+ var separator = wp.i18n._x( ',', 'tag delimiter' ) || ',';
function split( val ) {
return val.split( new RegExp( separator + '\\s*' ) );
@@ -104,7 +104,7 @@
if ( $.ui.keyCode.TAB === event.keyCode ) {
// Audible confirmation message when a tag has been selected.
- window.wp.a11y.speak( window.tagsSuggestL10n.termSelected, 'assertive' );
+ window.wp.a11y.speak( wp.i18n.__( 'Term selected.' ), 'assertive' );
event.preventDefault();
} else if ( $.ui.keyCode.ENTER === event.keyCode ) {
// If we're in the edit post Tags meta box, add the tag.
diff --git a/wp-admin/js/tags-suggest.min.js b/wp-admin/js/tags-suggest.min.js
index 1d4d6cd9be..dacc3f3f44 100644
--- a/wp-admin/js/tags-suggest.min.js
+++ b/wp-admin/js/tags-suggest.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-!function(r){if(void 0!==window.tagsSuggestL10n&&void 0!==window.uiAutocompleteL10n){var s=0,a=window.tagsSuggestL10n.tagDelimiter||",";r.fn.wpTagsSuggest=function(t){var i,o,n=r(this),u=(t=t||{}).taxonomy||n.attr("data-wp-taxonomy")||"post_tag";return delete t.taxonomy,t=r.extend({source:function(t,a){var e;o!==t.term?(e=function(t){return l(t).pop()}(t.term),r.get(window.ajaxurl,{action:"ajax-tag-search",tax:u,q:e}).always(function(){n.removeClass("ui-autocomplete-loading")}).done(function(t){var e,o=[];if(t){for(e in t=t.split("\n")){var n=++s;o.push({id:n,name:t[e]})}a(i=o)}else a(o)}),o=t.term):a(i)},focus:function(t,e){n.attr("aria-activedescendant","wp-tags-autocomplete-"+e.item.id),t.preventDefault()},select:function(t,e){var o=l(n.val());return o.pop(),o.push(e.item.name,""),n.val(o.join(a+" ")),r.ui.keyCode.TAB===t.keyCode?(window.wp.a11y.speak(window.tagsSuggestL10n.termSelected,"assertive"),t.preventDefault()):r.ui.keyCode.ENTER===t.keyCode&&(window.tagBox&&(window.tagBox.userAction="add",window.tagBox.flushTags(r(this).closest(".tagsdiv"))),t.preventDefault(),t.stopPropagation()),!1},open:function(){n.attr("aria-expanded","true")},close:function(){n.attr("aria-expanded","false")},minLength:2,position:{my:"left top+2",at:"left bottom",collision:"none"},messages:{noResults:window.uiAutocompleteL10n.noResults,results:function(t){return 1').text(e.name).appendTo(t)},n.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":n.autocomplete("widget").attr("id")}).on("focus",function(){l(n.val()).pop()&&n.autocomplete("search")}).autocomplete("widget").addClass("wp-tags-autocomplete").attr("role","listbox").removeAttr("tabindex").on("menufocus",function(t,e){e.item.attr("aria-selected","true")}).on("menublur",function(){r(this).find('[aria-selected="true"]').removeAttr("aria-selected")}),this}}function l(t){return t.split(new RegExp(a+"\\s*"))}}(jQuery);
\ No newline at end of file
+!function(u){if(void 0!==window.uiAutocompleteL10n){var s=0,a=wp.i18n._x(",","tag delimiter")||",";u.fn.wpTagsSuggest=function(e){var i,o,n=u(this),r=(e=e||{}).taxonomy||n.attr("data-wp-taxonomy")||"post_tag";return delete e.taxonomy,e=u.extend({source:function(e,a){var t;o!==e.term?(t=function(e){return l(e).pop()}(e.term),u.get(window.ajaxurl,{action:"ajax-tag-search",tax:r,q:t}).always(function(){n.removeClass("ui-autocomplete-loading")}).done(function(e){var t,o=[];if(e){for(t in e=e.split("\n")){var n=++s;o.push({id:n,name:e[t]})}a(i=o)}else a(o)}),o=e.term):a(i)},focus:function(e,t){n.attr("aria-activedescendant","wp-tags-autocomplete-"+t.item.id),e.preventDefault()},select:function(e,t){var o=l(n.val());return o.pop(),o.push(t.item.name,""),n.val(o.join(a+" ")),u.ui.keyCode.TAB===e.keyCode?(window.wp.a11y.speak(wp.i18n.__("Term selected."),"assertive"),e.preventDefault()):u.ui.keyCode.ENTER===e.keyCode&&(window.tagBox&&(window.tagBox.userAction="add",window.tagBox.flushTags(u(this).closest(".tagsdiv"))),e.preventDefault(),e.stopPropagation()),!1},open:function(){n.attr("aria-expanded","true")},close:function(){n.attr("aria-expanded","false")},minLength:2,position:{my:"left top+2",at:"left bottom",collision:"none"},messages:{noResults:window.uiAutocompleteL10n.noResults,results:function(e){return 1').text(t.name).appendTo(e)},n.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":n.autocomplete("widget").attr("id")}).on("focus",function(){l(n.val()).pop()&&n.autocomplete("search")}).autocomplete("widget").addClass("wp-tags-autocomplete").attr("role","listbox").removeAttr("tabindex").on("menufocus",function(e,t){t.item.attr("aria-selected","true")}).on("menublur",function(){u(this).find('[aria-selected="true"]').removeAttr("aria-selected")}),this}}function l(e){return e.split(new RegExp(a+"\\s*"))}}(jQuery);
\ No newline at end of file
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index 31f837a6f8..a09879f1fe 100644
--- a/wp-includes/script-loader.php
+++ b/wp-includes/script-loader.php
@@ -1212,19 +1212,10 @@ function wp_default_scripts( $scripts ) {
$scripts->set_translations( 'postbox' );
$scripts->add( 'tags-box', "/wp-admin/js/tags-box$suffix.js", array( 'jquery', 'tags-suggest' ), false, 1 );
+ $scripts->set_translations( 'tags-box' );
$scripts->add( 'tags-suggest', "/wp-admin/js/tags-suggest$suffix.js", array( 'jquery-ui-autocomplete', 'wp-a11y' ), false, 1 );
- did_action( 'init' ) && $scripts->localize(
- 'tags-suggest',
- 'tagsSuggestL10n',
- array(
- 'tagDelimiter' => _x( ',', 'tag delimiter' ),
- 'removeTerm' => __( 'Remove term:' ),
- 'termSelected' => __( 'Term selected.' ),
- 'termAdded' => __( 'Term added.' ),
- 'termRemoved' => __( 'Term removed.' ),
- )
- );
+ $scripts->set_translations( 'tags-suggest' );
$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count', 'wp-a11y', 'wp-sanitize', 'clipboard' ), false, 1 );
$scripts->set_translations( 'post' );
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 0a16130f9a..7a0c753afd 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
-$wp_version = '5.5-alpha-48349';
+$wp_version = '5.5-alpha-48350';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.