From 77b2440f9fa9389b26abe19a3102ea4779969f94 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Wed, 1 Jul 2020 19:50:02 +0000 Subject: [PATCH] I18N: Use `wp.i18n` for translatable strings in `wp-admin/js/common.js`. This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities. Props swissspidy, ocean90. See #20491. Fixes #50526. Built from https://develop.svn.wordpress.org/trunk@48267 git-svn-id: http://core.svn.wordpress.org/trunk@48036 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/common.js | 21 +++++++++++---------- wp-admin/js/common.min.js | 2 +- wp-includes/script-loader.php | 15 +++------------ wp-includes/version.php | 2 +- 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/wp-admin/js/common.js b/wp-admin/js/common.js index 4b287f6cd5..8734ee72f4 100644 --- a/wp-admin/js/common.js +++ b/wp-admin/js/common.js @@ -2,7 +2,7 @@ * @output wp-admin/js/common.js */ -/* global setUserSetting, ajaxurl, commonL10n, alert, confirm, pagenow */ +/* global setUserSetting, ajaxurl, alert, confirm, pagenow */ /* global columns, screenMeta */ /** @@ -15,7 +15,8 @@ ( function( $, window, undefined ) { var $document = $( document ), $window = $( window ), - $body = $( document.body ); + $body = $( document.body ), + __ = wp.i18n.__; /** * Removed in 3.3.0, needed for back-compatibility. @@ -188,8 +189,7 @@ window.showNotice = { * @return {boolean} Returns true if the message is confirmed. */ warn : function() { - var msg = commonL10n.warnDelete || ''; - if ( confirm(msg) ) { + if ( confirm( __( 'You are about to permanently delete these items from your site.\nThis action cannot be undone.\n\'Cancel\' to stop, \'OK\' to delete.' ) ) ) { return true; } @@ -757,11 +757,10 @@ $document.ready( function() { function makeNoticesDismissible() { $( '.notice.is-dismissible' ).each( function() { var $el = $( this ), - $button = $( '' ), - btnText = commonL10n.dismiss || ''; + $button = $( '' ); // Ensure plain text. - $button.find( '.screen-reader-text' ).text( btnText ); + $button.find( '.screen-reader-text' ).text( __( 'Dismiss this notice.' ) ); $button.on( 'click.wp-dismiss-notice', function( event ) { event.preventDefault(); $el.fadeTo( 100, 0, function() { @@ -1559,12 +1558,14 @@ $document.ready( function() { */ $document.on( 'wp-menu-state-set wp-collapse-menu', function( event, eventData ) { var $collapseButton = $( '#collapse-button' ), - ariaExpanded = 'true', - ariaLabelText = commonL10n.collapseMenu; + ariaExpanded, ariaLabelText; if ( 'folded' === eventData.state ) { ariaExpanded = 'false'; - ariaLabelText = commonL10n.expandMenu; + ariaLabelText = __( 'Expand Main menu' ); + } else { + ariaExpanded = 'true'; + ariaLabelText = __( 'Collapse Main menu' ); } $collapseButton.attr({ diff --git a/wp-admin/js/common.min.js b/wp-admin/js/common.min.js index b532e63dd2..c2e5c2a292 100644 --- a/wp-admin/js/common.min.js +++ b/wp-admin/js/common.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(Q,V){var q=Q(document),B=Q(V),H=Q(document.body);V.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},V.columns={init:function(){var n=this;Q(".hide-column-tog","#adv-settings").click(function(){var e=Q(this),t=e.val();e.prop("checked")?n.checked(t):n.unchecked(t),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var e=this.hidden();Q.post(ajaxurl,{action:"hidden-columns",hidden:e,screenoptionnonce:Q("#screenoptionnonce").val(),page:pagenow})},checked:function(e){Q(".column-"+e).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(e){Q(".column-"+e).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return Q(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return Q(".hide-column-tog").not(":checked").map(function(){var e=this.id;return e.substring(e,e.length-5)}).get().join(",")}},colSpanChange:function(e){var t,n=Q("table").find(".colspanchange");n.length&&(t=parseInt(n.attr("colspan"),10)+e,n.attr("colspan",t.toString()))}},q.ready(function(){columns.init()}),V.validateForm=function(e){return!Q(e).find(".form-required").filter(function(){return""===Q(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").change(function(){Q(this).closest(".form-invalid").removeClass("form-invalid")}).length},V.showNotice={warn:function(){var e=commonL10n.warnDelete||"";return!!confirm(e)},note:function(e){alert(e)}},V.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=Q("#screen-meta"),this.toggles=Q("#screen-meta-links").find(".show-settings"),this.page=Q("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(){var e=Q("#"+Q(this).attr("aria-controls"));e.length&&(e.is(":visible")?screenMeta.close(e,Q(this)):screenMeta.open(e,Q(this)))},open:function(e,t){Q("#screen-meta-links").find(".screen-meta-toggle").not(t.parent()).css("visibility","hidden"),e.parent().show(),e.slideDown("fast",function(){e.focus(),t.addClass("screen-meta-active").attr("aria-expanded",!0)}),q.trigger("screen:options:open")},close:function(e,t){e.slideUp("fast",function(){t.removeClass("screen-meta-active").attr("aria-expanded",!1),Q(".screen-meta-toggle").css("visibility",""),e.parent().hide()}),q.trigger("screen:options:close")}},Q(".contextual-help-tabs").delegate("a","click",function(e){var t,n=Q(this);if(e.preventDefault(),n.is(".active a"))return!1;Q(".contextual-help-tabs .active").removeClass("active"),n.parent("li").addClass("active"),t=Q(n.attr("href")),Q(".help-tab-content").not(t).removeClass("active").hide(),t.addClass("active").show()});var e,a=!1,r=Q("#permalink_structure"),t=Q(".permalink-structure input:radio"),l=Q("#custom_selection"),n=Q(".form-table.permalink-structure .available-structure-tags button");function c(e){-1!==r.val().indexOf(e.text().trim())?(e.attr("data-label",e.attr("aria-label")),e.attr("aria-label",e.attr("data-used")),e.attr("aria-pressed",!0),e.addClass("active")):e.attr("data-label")&&(e.attr("aria-label",e.attr("data-label")),e.attr("aria-pressed",!1),e.removeClass("active"))}function i(){q.trigger("wp-window-resized")}t.on("change",function(){"custom"!==this.value&&(r.val(this.value),n.each(function(){c(Q(this))}))}),r.on("click input",function(){l.prop("checked",!0)}),r.on("focus",function(e){a=!0,Q(this).off(e)}),n.each(function(){c(Q(this))}),r.on("change",function(){n.each(function(){c(Q(this))})}),n.on("click",function(){var e,t=r.val(),n=r[0].selectionStart,i=r[0].selectionEnd,o=Q(this).text().trim(),s=Q(this).attr("data-added");if(-1!==t.indexOf(o))return t=t.replace(o+"/",""),r.val("/"===t?"":t),Q("#custom_selection_updated").text(s),void c(Q(this));a||0!==n||0!==i||(n=i=t.length),l.prop("checked",!0),"/"!==t.substr(0,n).substr(-1)&&(o="/"+o),"/"!==t.substr(i,1)&&(o+="/"),r.val(t.substr(0,n)+o+t.substr(i)),Q("#custom_selection_updated").text(s),c(Q(this)),a&&r[0].setSelectionRange&&(e=(t.substr(0,n)+o).length,r[0].setSelectionRange(e,e),r.focus())}),q.ready(function(){var n,i,o,s,e,t,a,r,l,c,d,u=!1,p=Q("input.current-page"),f=p.val(),h=/iPhone|iPad|iPod/.test(navigator.userAgent),m=-1!==navigator.userAgent.indexOf("Android"),v=Q("#adminmenuwrap"),b=Q("#wpwrap"),g=Q("#adminmenu"),w=Q("#wp-responsive-overlay"),k=Q("#wp-toolbar"),C=k.find('a[aria-haspopup="true"]'),x=Q(".meta-box-sortables"),y=!1,S=Q("#wpadminbar"),D=0,M=!1,T=!1,E=0,j=!1,A={window:B.height(),wpwrap:b.height(),adminbar:S.height(),menu:v.height()},_=Q(".wp-header-end");function I(){var e=Q("a.wp-has-current-submenu");"folded"===r?e.attr("aria-haspopup","true"):e.attr("aria-haspopup","false")}function O(e){var t,n,i,o,s,a,r=e.find(".wp-submenu");a=(o=e.offset().top)-(s=B.scrollTop())-30,n=60+(t=o+r.height()+1)-b.height(),(i=B.height()+s-50)'),n=commonL10n.dismiss||"";e.find(".screen-reader-text").text(n),e.on("click.wp-dismiss-notice",function(e){e.preventDefault(),t.fadeTo(100,0,function(){t.slideUp(100,function(){t.remove()})})}),t.append(e)})}function K(){l.prop("disabled",""===c.map(function(){return Q(this).val()}).get().join(""))}function z(e){var t=B.scrollTop(),n=!e||"scroll"!==e.type;if(!h&&!g.data("wp-responsive"))if(A.menu+A.adminbarA.wpwrap)P();else{if(j=!0,A.menu+A.adminbar>A.window){if(t<0)return void(M||(T=!(M=!0),v.css({position:"fixed",top:"",bottom:""})));if(t+A.window>q.height()-1)return void(T||(M=!(T=!0),v.css({position:"fixed",top:"",bottom:0})));Dt+A.window&&(E=t),v.css({position:"absolute",top:E,bottom:""})):!M&&v.offset().top>=t+A.adminbar&&(M=!0,v.css({position:"fixed",top:"",bottom:""})):n&&(M=T=!1,0<(E=t+A.window-A.menu-A.adminbar-1)?v.css({position:"absolute",top:E,bottom:""}):P())}D=t}}function N(){A={window:B.height(),wpwrap:b.height(),adminbar:S.height(),menu:v.height()}}function P(){!h&&j&&(M=T=j=!1,v.css({position:"",top:"",bottom:""}))}function R(){N(),g.data("wp-responsive")?(H.removeClass("sticky-menu"),P()):A.menu+A.adminbar>A.window?(z(),H.removeClass("sticky-menu")):(H.addClass("sticky-menu"),P())}function W(){Q(".aria-button-if-js").attr("role","button")}function L(){var e=!1;return V.innerWidth&&(e=Math.max(V.innerWidth,document.documentElement.clientWidth)),e}function F(){var e=L()||961;r=e<=782?"responsive":H.hasClass("folded")||H.hasClass("auto-fold")&&e<=960&&782 tr > .check-column :checkbox",function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!u)return!0;n=Q(u).closest("form").find(":checkbox").filter(":visible:enabled"),i=n.index(u),o=n.index(this),s=Q(this).prop("checked"),0 a",function(e){g.data("wp-responsive")&&(Q(this).parent("li").toggleClass("selected"),e.preventDefault())}),e.trigger(),q.on("wp-window-resized.wp-responsive",Q.proxy(this.trigger,this)),B.on("load.wp-responsive",this.maybeDisableSortables),q.on("postbox-toggled",this.maybeDisableSortables),Q("#screen-options-wrap input").on("click",this.maybeDisableSortables)},maybeDisableSortables:function(){(-1').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){k.find(".menupop.hover").removeClass("hover"),Q(this).hide()})),C.on("click.wp-responsive",function(){w.show()})},disableOverlay:function(){C.off("click.wp-responsive"),w.hide()},disableSortables:function(){if(x.length)try{x.sortable("disable"),x.find(".ui-sortable-handle").addClass("is-non-sortable")}catch(e){}},enableSortables:function(){if(x.length)try{x.sortable("enable"),x.find(".ui-sortable-handle").removeClass("is-non-sortable")}catch(e){}}},Q(document).ajaxComplete(function(){W()}),q.on("wp-window-resized.set-menu-state",F),q.on("wp-menu-state-set wp-collapse-menu",function(e,t){var n=Q("#collapse-button"),i="true",o=commonL10n.collapseMenu;"folded"===t.state&&(i="false",o=commonL10n.expandMenu),n.attr({"aria-expanded":i,"aria-label":o})}),V.wpResponsive.init(),R(),F(),I(),U(),W(),q.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",R),Q(".wp-initial-focus").focus(),H.on("click",".js-update-details-toggle",function(){var e=Q(this).closest(".js-update-details"),t=Q("#"+e.data("update-details"));t.hasClass("update-details-moved")||t.insertAfter(e).addClass("update-details-moved"),t.toggle(),Q(this).attr("aria-expanded",t.is(":visible"))})}),B.on("resize.wp-fire-once",function(){V.clearTimeout(e),e=V.setTimeout(i,200)}),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var e=document.createElement("style");e.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(e)}}()}(jQuery,window); \ No newline at end of file +!function(V,q){var B=V(document),H=V(q),Y=V(document.body),G=wp.i18n.__;q.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},q.columns={init:function(){var n=this;V(".hide-column-tog","#adv-settings").click(function(){var e=V(this),t=e.val();e.prop("checked")?n.checked(t):n.unchecked(t),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var e=this.hidden();V.post(ajaxurl,{action:"hidden-columns",hidden:e,screenoptionnonce:V("#screenoptionnonce").val(),page:pagenow})},checked:function(e){V(".column-"+e).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(e){V(".column-"+e).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return V(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return V(".hide-column-tog").not(":checked").map(function(){var e=this.id;return e.substring(e,e.length-5)}).get().join(",")}},colSpanChange:function(e){var t,n=V("table").find(".colspanchange");n.length&&(t=parseInt(n.attr("colspan"),10)+e,n.attr("colspan",t.toString()))}},B.ready(function(){columns.init()}),q.validateForm=function(e){return!V(e).find(".form-required").filter(function(){return""===V(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").change(function(){V(this).closest(".form-invalid").removeClass("form-invalid")}).length},q.showNotice={warn:function(){return!!confirm(G("You are about to permanently delete these items from your site.\nThis action cannot be undone.\n'Cancel' to stop, 'OK' to delete."))},note:function(e){alert(e)}},q.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=V("#screen-meta"),this.toggles=V("#screen-meta-links").find(".show-settings"),this.page=V("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(){var e=V("#"+V(this).attr("aria-controls"));e.length&&(e.is(":visible")?screenMeta.close(e,V(this)):screenMeta.open(e,V(this)))},open:function(e,t){V("#screen-meta-links").find(".screen-meta-toggle").not(t.parent()).css("visibility","hidden"),e.parent().show(),e.slideDown("fast",function(){e.focus(),t.addClass("screen-meta-active").attr("aria-expanded",!0)}),B.trigger("screen:options:open")},close:function(e,t){e.slideUp("fast",function(){t.removeClass("screen-meta-active").attr("aria-expanded",!1),V(".screen-meta-toggle").css("visibility",""),e.parent().hide()}),B.trigger("screen:options:close")}},V(".contextual-help-tabs").delegate("a","click",function(e){var t,n=V(this);if(e.preventDefault(),n.is(".active a"))return!1;V(".contextual-help-tabs .active").removeClass("active"),n.parent("li").addClass("active"),t=V(n.attr("href")),V(".help-tab-content").not(t).removeClass("active").hide(),t.addClass("active").show()});var e,a=!1,r=V("#permalink_structure"),t=V(".permalink-structure input:radio"),l=V("#custom_selection"),n=V(".form-table.permalink-structure .available-structure-tags button");function c(e){-1!==r.val().indexOf(e.text().trim())?(e.attr("data-label",e.attr("aria-label")),e.attr("aria-label",e.attr("data-used")),e.attr("aria-pressed",!0),e.addClass("active")):e.attr("data-label")&&(e.attr("aria-label",e.attr("data-label")),e.attr("aria-pressed",!1),e.removeClass("active"))}function i(){B.trigger("wp-window-resized")}t.on("change",function(){"custom"!==this.value&&(r.val(this.value),n.each(function(){c(V(this))}))}),r.on("click input",function(){l.prop("checked",!0)}),r.on("focus",function(e){a=!0,V(this).off(e)}),n.each(function(){c(V(this))}),r.on("change",function(){n.each(function(){c(V(this))})}),n.on("click",function(){var e,t=r.val(),n=r[0].selectionStart,i=r[0].selectionEnd,o=V(this).text().trim(),s=V(this).attr("data-added");if(-1!==t.indexOf(o))return t=t.replace(o+"/",""),r.val("/"===t?"":t),V("#custom_selection_updated").text(s),void c(V(this));a||0!==n||0!==i||(n=i=t.length),l.prop("checked",!0),"/"!==t.substr(0,n).substr(-1)&&(o="/"+o),"/"!==t.substr(i,1)&&(o+="/"),r.val(t.substr(0,n)+o+t.substr(i)),V("#custom_selection_updated").text(s),c(V(this)),a&&r[0].setSelectionRange&&(e=(t.substr(0,n)+o).length,r[0].setSelectionRange(e,e),r.focus())}),B.ready(function(){var n,i,o,s,e,t,a,r,l,c,d,u=!1,p=V("input.current-page"),f=p.val(),h=/iPhone|iPad|iPod/.test(navigator.userAgent),m=-1!==navigator.userAgent.indexOf("Android"),b=V("#adminmenuwrap"),v=V("#wpwrap"),g=V("#adminmenu"),w=V("#wp-responsive-overlay"),k=V("#wp-toolbar"),C=k.find('a[aria-haspopup="true"]'),y=V(".meta-box-sortables"),x=!1,S=V("#wpadminbar"),D=0,M=!1,T=!1,E=0,_=!1,j={window:H.height(),wpwrap:v.height(),adminbar:S.height(),menu:b.height()},A=V(".wp-header-end");function O(){var e=V("a.wp-has-current-submenu");"folded"===r?e.attr("aria-haspopup","true"):e.attr("aria-haspopup","false")}function I(e){var t,n,i,o,s,a,r=e.find(".wp-submenu");a=(o=e.offset().top)-(s=H.scrollTop())-30,n=60+(t=o+r.height()+1)-v.height(),(i=H.height()+s-50)');e.find(".screen-reader-text").text(G("Dismiss this notice.")),e.on("click.wp-dismiss-notice",function(e){e.preventDefault(),t.fadeTo(100,0,function(){t.slideUp(100,function(){t.remove()})})}),t.append(e)})}function U(){l.prop("disabled",""===c.map(function(){return V(this).val()}).get().join(""))}function z(e){var t=H.scrollTop(),n=!e||"scroll"!==e.type;if(!h&&!g.data("wp-responsive"))if(j.menu+j.adminbarj.wpwrap)P();else{if(_=!0,j.menu+j.adminbar>j.window){if(t<0)return void(M||(T=!(M=!0),b.css({position:"fixed",top:"",bottom:""})));if(t+j.window>B.height()-1)return void(T||(M=!(T=!0),b.css({position:"fixed",top:"",bottom:0})));Dt+j.window&&(E=t),b.css({position:"absolute",top:E,bottom:""})):!M&&b.offset().top>=t+j.adminbar&&(M=!0,b.css({position:"fixed",top:"",bottom:""})):n&&(M=T=!1,0<(E=t+j.window-j.menu-j.adminbar-1)?b.css({position:"absolute",top:E,bottom:""}):P())}D=t}}function N(){j={window:H.height(),wpwrap:v.height(),adminbar:S.height(),menu:b.height()}}function P(){!h&&_&&(M=T=_=!1,b.css({position:"",top:"",bottom:""}))}function R(){N(),g.data("wp-responsive")?(Y.removeClass("sticky-menu"),P()):j.menu+j.adminbar>j.window?(z(),Y.removeClass("sticky-menu")):(Y.addClass("sticky-menu"),P())}function W(){V(".aria-button-if-js").attr("role","button")}function F(){var e=!1;return q.innerWidth&&(e=Math.max(q.innerWidth,document.documentElement.clientWidth)),e}function Q(){var e=F()||961;r=e<=782?"responsive":Y.hasClass("folded")||Y.hasClass("auto-fold")&&e<=960&&782 tr > .check-column :checkbox",function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!u)return!0;n=V(u).closest("form").find(":checkbox").filter(":visible:enabled"),i=n.index(u),o=n.index(this),s=V(this).prop("checked"),0 a",function(e){g.data("wp-responsive")&&(V(this).parent("li").toggleClass("selected"),e.preventDefault())}),e.trigger(),B.on("wp-window-resized.wp-responsive",V.proxy(this.trigger,this)),H.on("load.wp-responsive",this.maybeDisableSortables),B.on("postbox-toggled",this.maybeDisableSortables),V("#screen-options-wrap input").on("click",this.maybeDisableSortables)},maybeDisableSortables:function(){(-1').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){k.find(".menupop.hover").removeClass("hover"),V(this).hide()})),C.on("click.wp-responsive",function(){w.show()})},disableOverlay:function(){C.off("click.wp-responsive"),w.hide()},disableSortables:function(){if(y.length)try{y.sortable("disable"),y.find(".ui-sortable-handle").addClass("is-non-sortable")}catch(e){}},enableSortables:function(){if(y.length)try{y.sortable("enable"),y.find(".ui-sortable-handle").removeClass("is-non-sortable")}catch(e){}}},V(document).ajaxComplete(function(){W()}),B.on("wp-window-resized.set-menu-state",Q),B.on("wp-menu-state-set wp-collapse-menu",function(e,t){var n,i,o=V("#collapse-button");i="folded"===t.state?(n="false",G("Expand Main menu")):(n="true",G("Collapse Main menu")),o.attr({"aria-expanded":n,"aria-label":i})}),q.wpResponsive.init(),R(),Q(),O(),K(),W(),B.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",R),V(".wp-initial-focus").focus(),Y.on("click",".js-update-details-toggle",function(){var e=V(this).closest(".js-update-details"),t=V("#"+e.data("update-details"));t.hasClass("update-details-moved")||t.insertAfter(e).addClass("update-details-moved"),t.toggle(),V(this).attr("aria-expanded",t.is(":visible"))})}),H.on("resize.wp-fire-once",function(){q.clearTimeout(e),e=q.setTimeout(i,200)}),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var e=document.createElement("style");e.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(e)}}()}(jQuery,window); \ No newline at end of file diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 35b5823104..3141b9b897 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -608,16 +608,7 @@ function wp_default_scripts( $scripts ) { ); $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array( 'jquery', 'hoverIntent', 'utils' ), false, 1 ); - did_action( 'init' ) && $scripts->localize( - 'common', - 'commonL10n', - array( - 'warnDelete' => __( "You are about to permanently delete these items from your site.\nThis action cannot be undone.\n 'Cancel' to stop, 'OK' to delete." ), - 'dismiss' => __( 'Dismiss this notice.' ), - 'collapseMenu' => __( 'Collapse Main menu' ), - 'expandMenu' => __( 'Expand Main menu' ), - ) - ); + $scripts->set_translations( 'common' ); $scripts->add( 'wp-sanitize', "/wp-includes/js/wp-sanitize$suffix.js", array(), false, 1 ); @@ -809,8 +800,8 @@ function wp_default_scripts( $scripts ) { // Masonry v2 depended on jQuery. v3 does not. The older jquery-masonry handle is a shiv. // It sets jQuery as a dependency, as the theme may have been implicitly loading it this way. - $scripts->add( 'imagesloaded', '/wp-includes/js/imagesloaded.min.js', array(), '4.1.4', 1 ); - $scripts->add( 'masonry', '/wp-includes/js/masonry.min.js', array( 'imagesloaded' ), '4.2.2', 1 ); + $scripts->add( 'imagesloaded', '/wp-includes/js/imagesloaded.min.js', array(), '3.2.0', 1 ); + $scripts->add( 'masonry', '/wp-includes/js/masonry.min.js', array( 'imagesloaded' ), '3.3.2', 1 ); $scripts->add( 'jquery-masonry', "/wp-includes/js/jquery/jquery.masonry$dev_suffix.js", array( 'jquery', 'masonry' ), '3.1.2b', 1 ); $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array( 'jquery' ), '3.1-20121105', 1 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index ddd97acf0e..35154da1c1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-48266'; +$wp_version = '5.5-alpha-48267'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.