Widgets: Avoid a TypeError when adding a widget in the Customizer.
This fixes a bug where `action` is set to `null` when adding a widget in the Customizer. Fixes #53488. See #53421, #53419. Built from https://develop.svn.wordpress.org/trunk@51238 git-svn-id: http://core.svn.wordpress.org/trunk@50847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
eeb8c63240
commit
5e2b659090
|
@ -120,6 +120,8 @@ window.wp = window.wp || {};
|
|||
var context = this;
|
||||
deferred.done( function() {
|
||||
if (
|
||||
action &&
|
||||
action.data &&
|
||||
'query-attachments' === action.data.action &&
|
||||
deferred.jqXHR.hasOwnProperty( 'getResponseHeader' ) &&
|
||||
deferred.jqXHR.getResponseHeader( 'X-WP-Total' )
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
/*! This file is auto-generated */
|
||||
window.wp=window.wp||{},function(s){var e="undefined"==typeof _wpUtilSettings?{}:_wpUtilSettings;wp.template=_.memoize(function(t){var a,n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(e){return(a=a||_.template(s("#tmpl-"+t).html(),n))(e)}}),wp.ajax={settings:e.ajax||{},post:function(e,t){return wp.ajax.send({data:_.isObject(e)?e:_.extend(t||{},{action:e})})},send:function(n,e){var t,a;return _.isObject(n)?e=n:(e=e||{}).data=_.extend(e.data||{},{action:n}),e=_.defaults(e||{},{type:"POST",url:wp.ajax.settings.url,context:this}),(t=(a=s.Deferred(function(a){e.success&&a.done(e.success),e.error&&a.fail(e.error),delete e.success,delete e.error,a.jqXHR=s.ajax(e).done(function(e){var t;"1"!==e&&1!==e||(e={success:!0}),_.isObject(e)&&!_.isUndefined(e.success)?(t=this,a.done(function(){"query-attachments"===n.data.action&&a.jqXHR.hasOwnProperty("getResponseHeader")&&a.jqXHR.getResponseHeader("X-WP-Total")?t.totalAttachments=parseInt(a.jqXHR.getResponseHeader("X-WP-Total"),10):t.totalAttachments=0}),a[e.success?"resolveWith":"rejectWith"](this,[e.data])):a.rejectWith(this,[e])}).fail(function(){a.rejectWith(this,arguments)})})).promise()).abort=function(){return a.jqXHR.abort(),this},t}}}(jQuery);
|
||||
window.wp=window.wp||{},function(s){var t="undefined"==typeof _wpUtilSettings?{}:_wpUtilSettings;wp.template=_.memoize(function(e){var a,n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(t){return(a=a||_.template(s("#tmpl-"+e).html(),n))(t)}}),wp.ajax={settings:t.ajax||{},post:function(t,e){return wp.ajax.send({data:_.isObject(t)?t:_.extend(e||{},{action:t})})},send:function(n,t){var e,a;return _.isObject(n)?t=n:(t=t||{}).data=_.extend(t.data||{},{action:n}),t=_.defaults(t||{},{type:"POST",url:wp.ajax.settings.url,context:this}),(e=(a=s.Deferred(function(a){t.success&&a.done(t.success),t.error&&a.fail(t.error),delete t.success,delete t.error,a.jqXHR=s.ajax(t).done(function(t){var e;"1"!==t&&1!==t||(t={success:!0}),_.isObject(t)&&!_.isUndefined(t.success)?(e=this,a.done(function(){n&&n.data&&"query-attachments"===n.data.action&&a.jqXHR.hasOwnProperty("getResponseHeader")&&a.jqXHR.getResponseHeader("X-WP-Total")?e.totalAttachments=parseInt(a.jqXHR.getResponseHeader("X-WP-Total"),10):e.totalAttachments=0}),a[t.success?"resolveWith":"rejectWith"](this,[t.data])):a.rejectWith(this,[t])}).fail(function(){a.rejectWith(this,arguments)})})).promise()).abort=function(){return a.jqXHR.abort(),this},e}}}(jQuery);
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.8-beta3-51237';
|
||||
$wp_version = '5.8-beta3-51238';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue