From 5c10f75f9ef863013488d0cf7043be6561f644a8 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sun, 18 Jun 2023 14:24:20 +0000 Subject: [PATCH] Media: Deprecate the 'edit_custom_thumbnail_sizes' filter and disable the "Apply changes to [Thumbnail|All|All except thumbnail]" UI in the image editor. Add a (boolean) filter to reenable that UI. Props peterwilsoncc, costdev, azaozz. See: #57685. Built from https://develop.svn.wordpress.org/trunk@55935 git-svn-id: http://core.svn.wordpress.org/trunk@55447 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/image-edit.php | 58 ++++++++++---------------------- wp-admin/js/image-edit.js | 12 +++++-- wp-admin/js/image-edit.min.js | 2 +- wp-includes/version.php | 2 +- 4 files changed, 28 insertions(+), 46 deletions(-) diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index 3ecb38ceb8..9af0f5b1e2 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -43,15 +43,16 @@ function wp_image_editor( $post_id, $msg = false ) { $note = ""; } } - $edit_custom_sizes = false; + /** - * Filters whether custom sizes are available options for image editing. + * Shows the settings in the Image Editor that allow selecting to edit only the thumbnail of an image. * - * @since 6.0.0 + * @since 6.3.0 * - * @param bool|string[] $edit_custom_sizes True if custom sizes can be edited or array of custom size names. + * @param bool Whether to show the settings in the Image Editor. Default false. */ - $edit_custom_sizes = apply_filters( 'edit_custom_thumbnail_sizes', $edit_custom_sizes ); + $edit_thumbnails_separately = (bool) apply_filters( 'image_edit_thumbnails_separately', false ); + ?>
@@ -272,7 +273,7 @@ function wp_image_editor( $post_id, $msg = false ) {
@@ -307,32 +308,12 @@ function wp_image_editor( $post_id, $msg = false ) { - + - $size ) { - if ( array_key_exists( $size, $meta['sizes'] ) ) { - if ( 'thumbnail' === $size ) { - continue; - } - ?> - - - - -
@@ -918,6 +899,9 @@ function wp_save_image( $post_id ) { $target = ! empty( $_REQUEST['target'] ) ? preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['target'] ) : ''; $scale = ! empty( $_REQUEST['do'] ) && 'scale' === $_REQUEST['do']; + /** This filter is documented in wp-admin/includes/image-edit.php */ + $edit_thumbnails_separately = (bool) apply_filters( 'image_edit_thumbnails_separately', false ); + if ( $scale ) { $size = $img->get_size(); $sX = $size['width']; @@ -977,7 +961,7 @@ function wp_save_image( $post_id ) { if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE && isset( $backup_sizes['full-orig'] ) && $backup_sizes['full-orig']['file'] != $basename ) { - if ( 'thumbnail' === $target ) { + if ( $edit_thumbnails_separately && 'thumbnail' === $target ) { $new_path = "{$dirname}/{$filename}-temp.{$ext}"; } else { $new_path = $path; @@ -1027,29 +1011,21 @@ function wp_save_image( $post_id ) { $meta['width'] = $size['width']; $meta['height'] = $size['height']; - if ( $success ) { + if ( $success && ( 'nothumb' === $target || 'all' === $target ) ) { $sizes = get_intermediate_image_sizes(); - if ( 'nothumb' === $target || 'all' === $target ) { - if ( 'nothumb' === $target ) { - $sizes = array_diff( $sizes, array( 'thumbnail' ) ); - } - } elseif ( 'thumbnail' !== $target ) { - $sizes = array_diff( $sizes, array( $target ) ); + + if ( $edit_thumbnails_separately && 'nothumb' === $target ) { + $sizes = array_diff( $sizes, array( 'thumbnail' ) ); } } $return->fw = $meta['width']; $return->fh = $meta['height']; - } elseif ( 'thumbnail' === $target ) { + } elseif ( $edit_thumbnails_separately && 'thumbnail' === $target ) { $sizes = array( 'thumbnail' ); $success = true; $delete = true; $nocrop = true; - } else { - $sizes = array( $target ); - $success = true; - $delete = true; - $nocrop = $_wp_additional_image_sizes[ $size ]['crop']; } /* diff --git a/wp-admin/js/image-edit.js b/wp-admin/js/image-edit.js index 167ee0f17b..8f44e930be 100644 --- a/wp-admin/js/image-edit.js +++ b/wp-admin/js/image-edit.js @@ -358,10 +358,16 @@ * @param {number} postid The post ID. * * @return {string} The value from the imagedit-save-target input field when available, - * or 'full' when not available. + * 'full' when not selected, or 'all' if it doesn't exist. */ - getTarget : function(postid) { - return $('input[name="imgedit-target-' + postid + '"]:checked', '#imgedit-save-target-' + postid).val() || 'full'; + getTarget : function( postid ) { + var element = $( '#imgedit-save-target-' + postid ); + + if ( element.length ) { + return element.find( 'input[name="imgedit-target-' + postid + '"]:checked' ).val() || 'full'; + } + + return 'all'; }, /** diff --git a/wp-admin/js/image-edit.min.js b/wp-admin/js/image-edit.min.js index 151d6ca141..4f4f4f9ebc 100644 --- a/wp-admin/js/image-edit.min.js +++ b/wp-admin/js/image-edit.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(c){var n=wp.i18n.__,l=window.imageEdit={iasapi:{},hold:{},postid:"",_view:!1,toggleCropTool:function(t,i,e){var a,o,s,r=c("#image-preview-"+t),n=this.iasapi.getSelection();l.toggleControls(e),"false"==("true"===c(e).attr("aria-expanded")?"true":"false")?(this.iasapi.cancelSelection(),l.setDisabled(c(".imgedit-crop-clear"),0)):(l.setDisabled(c(".imgedit-crop-clear"),1),e=c("#imgedit-start-x-"+t).val()?c("#imgedit-start-x-"+t).val():0,a=c("#imgedit-start-y-"+t).val()?c("#imgedit-start-y-"+t).val():0,o=c("#imgedit-sel-width-"+t).val()?c("#imgedit-sel-width-"+t).val():r.innerWidth(),s=c("#imgedit-sel-height-"+t).val()?c("#imgedit-sel-height-"+t).val():r.innerHeight(),isNaN(n.x1)&&(this.setCropSelection(t,{x1:e,y1:a,x2:o,y2:s,width:o,height:s}),n=this.iasapi.getSelection()),0===n.x1&&0===n.y1&&0===n.x2&&0===n.y2?this.iasapi.setSelection(0,0,r.innerWidth(),r.innerHeight(),!0):this.iasapi.setSelection(e,a,o,s,!0),this.iasapi.setOptions({show:!0}),this.iasapi.update())},handleCropToolClick:function(t,i,e){e.classList.contains("imgedit-crop-clear")?(this.iasapi.cancelSelection(),l.setDisabled(c(".imgedit-crop-apply"),0),c("#imgedit-sel-width-"+t).val(""),c("#imgedit-sel-height-"+t).val(""),c("#imgedit-start-x-"+t).val("0"),c("#imgedit-start-y-"+t).val("0"),c("#imgedit-selection-"+t).val("")):l.crop(t,i,e)},intval:function(t){return 0|t},setDisabled:function(t,i){i?t.removeClass("disabled").prop("disabled",!1):t.addClass("disabled").prop("disabled",!0)},init:function(e){var t=this,i=c("#image-editor-"+t.postid),a=t.intval(c("#imgedit-x-"+e).val()),o=t.intval(c("#imgedit-y-"+e).val());t.postid!==e&&i.length&&t.close(t.postid),t.hold.w=t.hold.ow=a,t.hold.h=t.hold.oh=o,t.hold.xy_ratio=a/o,t.hold.sizer=parseFloat(c("#imgedit-sizer-"+e).val()),t.postid=e,c("#imgedit-response-"+e).empty(),c("#imgedit-panel-"+e).on("keypress",function(t){var i=c("#imgedit-nonce-"+e).val();26===t.which&&t.ctrlKey&&l.undo(e,i),25===t.which&&t.ctrlKey&&l.redo(e,i)}),c("#imgedit-panel-"+e).on("keypress",'input[type="text"]',function(t){var i=t.keyCode;if(36this.hold.oh||s&&s>this.hold.ow?(t.css("visibility","visible"),n.prop("disabled",!0)):(t.css("visibility","hidden"),n.prop("disabled",!1)))},getSelRatio:function(t){var i=this.hold.w,e=this.hold.h,a=this.intval(c("#imgedit-crop-width-"+t).val()),t=this.intval(c("#imgedit-crop-height-"+t).val());return a&&t?a+":"+t:i&&e?i+":"+e:"1:1"},filterHistory:function(t,i){var e,a,o,s=c("#imgedit-history-"+t).val(),r=[];if(""===s)return"";if(s=JSON.parse(s),0<(e=this.intval(c("#imgedit-undone-"+t).val())))for(;0').on("load",{history:t.history},function(t){var i=c("#imgedit-crop-"+o),e=l,a=(""!==t.data.history&&(t=JSON.parse(t.data.history))[t.length-1].hasOwnProperty("c")&&(e.setDisabled(c("#image-undo-"+o),!0),c("#image-undo-"+o).trigger("focus")),i.empty().append(r),t=Math.max(e.hold.w,e.hold.h),a=Math.max(c(r).width(),c(r).height()),e.hold.sizer=a

'+t+"

"),i.toggleEditor(o,0,!0),wp.a11y.speak(t,"assertive")}).attr("src",ajaxurl+"?"+c.param(t))},action:function(i,t,e){var a,o,s,r,n=this;if(n.notsaved(i))return!1;if(t={action:"image-editor",_ajax_nonce:t,postid:i},"scale"===e){if(a=c("#imgedit-scale-width-"+i),o=c("#imgedit-scale-height-"+i),s=n.intval(a.val()),r=n.intval(o.val()),s<1)return a.trigger("focus"),!1;if(r<1)return o.trigger("focus"),!1;if(s===n.hold.ow||r===n.hold.oh)return!1;t.do="scale",t.fwidth=s,t.fheight=r}else{if("restore"!==e)return!1;t.do="restore"}n.toggleEditor(i,1),c.post(ajaxurl,t,function(t){c("#image-editor-"+i).empty().append(t.data.html),n.toggleEditor(i,0,!0),n._view&&n._view.refresh()}).done(function(t){t&&t.data.message.msg?wp.a11y.speak(t.data.message.msg):t&&t.data.message.error&&wp.a11y.speak(t.data.message.error)})},save:function(i,t){var e=this.getTarget(i),a=this.filterHistory(i,0),o=this;if(""===a)return!1;this.toggleEditor(i,1),t={action:"image-editor",_ajax_nonce:t,postid:i,history:a,target:e,context:c("#image-edit-context").length?c("#image-edit-context").val():null,do:"save"},c.post(ajaxurl,t,function(t){t.data.error?(c("#imgedit-response-"+i).html('"),l.close(i),wp.a11y.speak(t.data.error)):(t.data.fw&&t.data.fh&&c("#media-dims-"+i).html(t.data.fw+" × "+t.data.fh),t.data.thumbnail&&c(".thumbnail","#thumbnail-head-"+i).attr("src",""+t.data.thumbnail),t.data.msg&&(c("#imgedit-response-"+i).html('"),wp.a11y.speak(t.data.msg)),o._view?o._view.save():l.close(i))})},open:function(e,t,i){this._view=i;var a=c("#image-editor-"+e),o=c("#media-head-"+e),s=c("#imgedit-open-btn-"+e),r=s.siblings(".spinner");if(!s.hasClass("button-activated"))return r.addClass("is-active"),c.ajax({url:ajaxurl,type:"post",data:{action:"image-editor",_ajax_nonce:t,postid:e,do:"open"},beforeSend:function(){s.addClass("button-activated")}}).done(function(t){var i;"-1"===t&&(i=n("Could not load the preview image."),a.html('")),t.data&&t.data.html&&a.html(t.data.html),o.fadeOut("fast",function(){a.fadeIn("fast",function(){i&&c(document).trigger("image-editor-ui-ready")}),s.removeClass("button-activated"),r.removeClass("is-active")}),l.init(e)})},imgLoaded:function(t){var i=c("#image-preview-"+t),e=c("#imgedit-crop-"+t);void 0===this.hold.sizer&&this.init(t),this.initCrop(t,i,e),this.setCropSelection(t,{x1:0,y1:0,x2:0,y2:0,width:i.innerWidth(),height:i.innerHeight()}),this.toggleEditor(t,0,!0)},focusManager:function(){setTimeout(function(){var t=c('.notice[role="alert"]');(t=t.length?t:c(".imgedit-wrap").find(":tabbable:first")).trigger("focus")},100)},initCrop:function(a,t,i){var o=this,s=c("#imgedit-sel-width-"+a),r=c("#imgedit-sel-height-"+a),n=c("#imgedit-start-x-"+a),d=c("#imgedit-start-y-"+a),t=c(t);t.data("imgAreaSelect")||(o.iasapi=t.imgAreaSelect({parent:i,instance:!0,handles:!0,keys:!0,minWidth:3,minHeight:3,onInit:function(t){c(t).next().css("position","absolute").nextAll(".imgareaselect-outer").css("position","absolute"),i.children().on("mousedown, touchstart",function(t){var i,e=!1;t.shiftKey&&(t=o.iasapi.getSelection(),i=o.getSelRatio(a),e=t&&t.width&&t.height?t.width+":"+t.height:i),o.iasapi.setOptions({aspectRatio:e})})},onSelectStart:function(){l.setDisabled(c("#imgedit-crop-sel-"+a),1),l.setDisabled(c(".imgedit-crop-clear"),1),l.setDisabled(c(".imgedit-crop-apply"),1)},onSelectEnd:function(t,i){l.setCropSelection(a,i),c("#imgedit-crop > *").is(":visible")||l.toggleControls(c(".imgedit-crop.button"))},onSelectChange:function(t,i){var e=l.hold.sizer;s.val(l.round(i.width/e)),r.val(l.round(i.height/e)),n.val(l.round(i.x1/e)),d.val(l.round(i.y1/e))}}))},setCropSelection:function(t,i){if(!(i=i||0)||i.width<3&&i.height<3)return this.setDisabled(c(".imgedit-crop","#imgedit-panel-"+t),1),this.setDisabled(c("#imgedit-crop-sel-"+t),1),c("#imgedit-sel-width-"+t).val(""),c("#imgedit-sel-height-"+t).val(""),c("#imgedit-start-x-"+t).val("0"),c("#imgedit-start-y-"+t).val("0"),c("#imgedit-selection-"+t).val(""),!1;i={x:i.x1,y:i.y1,w:i.width,h:i.height},this.setDisabled(c(".imgedit-crop","#imgedit-panel-"+t),1),c("#imgedit-selection-"+t).val(JSON.stringify(i))},close:function(t,i){if((i=i||!1)&&this.notsaved(t))return!1;this.iasapi={},this.hold={},this._view?this._view.back():c("#image-editor-"+t).fadeOut("fast",function(){c("#media-head-"+t).fadeIn("fast",function(){c("#imgedit-open-btn-"+t).trigger("focus")}),c(this).empty()})},notsaved:function(t){var i=c("#imgedit-history-"+t).val(),i=""!==i?JSON.parse(i):[];return this.intval(c("#imgedit-undone-"+t).val())

'+o+"

"),wp.a11y.speak(o,"assertive"),c(i?"#imgedit-crop-height-"+t:"#imgedit-crop-width-"+t).val("")):void 0!==(s=c("#imgedit-crop-"+t).find(".notice-error"))&&s.remove(),this.iasapi.setSelection(e.x1,e.y1,e.x2,a),this.iasapi.update())},validateNumeric:function(t){if(!1===this.intval(c(t).val()))return c(t).val(""),!1}}}(jQuery); \ No newline at end of file +!function(c){var n=wp.i18n.__,l=window.imageEdit={iasapi:{},hold:{},postid:"",_view:!1,toggleCropTool:function(t,i,e){var a,o,s,r=c("#image-preview-"+t),n=this.iasapi.getSelection();l.toggleControls(e),"false"==("true"===c(e).attr("aria-expanded")?"true":"false")?(this.iasapi.cancelSelection(),l.setDisabled(c(".imgedit-crop-clear"),0)):(l.setDisabled(c(".imgedit-crop-clear"),1),e=c("#imgedit-start-x-"+t).val()?c("#imgedit-start-x-"+t).val():0,a=c("#imgedit-start-y-"+t).val()?c("#imgedit-start-y-"+t).val():0,o=c("#imgedit-sel-width-"+t).val()?c("#imgedit-sel-width-"+t).val():r.innerWidth(),s=c("#imgedit-sel-height-"+t).val()?c("#imgedit-sel-height-"+t).val():r.innerHeight(),isNaN(n.x1)&&(this.setCropSelection(t,{x1:e,y1:a,x2:o,y2:s,width:o,height:s}),n=this.iasapi.getSelection()),0===n.x1&&0===n.y1&&0===n.x2&&0===n.y2?this.iasapi.setSelection(0,0,r.innerWidth(),r.innerHeight(),!0):this.iasapi.setSelection(e,a,o,s,!0),this.iasapi.setOptions({show:!0}),this.iasapi.update())},handleCropToolClick:function(t,i,e){e.classList.contains("imgedit-crop-clear")?(this.iasapi.cancelSelection(),l.setDisabled(c(".imgedit-crop-apply"),0),c("#imgedit-sel-width-"+t).val(""),c("#imgedit-sel-height-"+t).val(""),c("#imgedit-start-x-"+t).val("0"),c("#imgedit-start-y-"+t).val("0"),c("#imgedit-selection-"+t).val("")):l.crop(t,i,e)},intval:function(t){return 0|t},setDisabled:function(t,i){i?t.removeClass("disabled").prop("disabled",!1):t.addClass("disabled").prop("disabled",!0)},init:function(e){var t=this,i=c("#image-editor-"+t.postid),a=t.intval(c("#imgedit-x-"+e).val()),o=t.intval(c("#imgedit-y-"+e).val());t.postid!==e&&i.length&&t.close(t.postid),t.hold.w=t.hold.ow=a,t.hold.h=t.hold.oh=o,t.hold.xy_ratio=a/o,t.hold.sizer=parseFloat(c("#imgedit-sizer-"+e).val()),t.postid=e,c("#imgedit-response-"+e).empty(),c("#imgedit-panel-"+e).on("keypress",function(t){var i=c("#imgedit-nonce-"+e).val();26===t.which&&t.ctrlKey&&l.undo(e,i),25===t.which&&t.ctrlKey&&l.redo(e,i)}),c("#imgedit-panel-"+e).on("keypress",'input[type="text"]',function(t){var i=t.keyCode;if(36this.hold.oh||s&&s>this.hold.ow?(t.css("visibility","visible"),n.prop("disabled",!0)):(t.css("visibility","hidden"),n.prop("disabled",!1)))},getSelRatio:function(t){var i=this.hold.w,e=this.hold.h,a=this.intval(c("#imgedit-crop-width-"+t).val()),t=this.intval(c("#imgedit-crop-height-"+t).val());return a&&t?a+":"+t:i&&e?i+":"+e:"1:1"},filterHistory:function(t,i){var e,a,o,s=c("#imgedit-history-"+t).val(),r=[];if(""===s)return"";if(s=JSON.parse(s),0<(e=this.intval(c("#imgedit-undone-"+t).val())))for(;0').on("load",{history:t.history},function(t){var i=c("#imgedit-crop-"+o),e=l,a=(""!==t.data.history&&(t=JSON.parse(t.data.history))[t.length-1].hasOwnProperty("c")&&(e.setDisabled(c("#image-undo-"+o),!0),c("#image-undo-"+o).trigger("focus")),i.empty().append(r),t=Math.max(e.hold.w,e.hold.h),a=Math.max(c(r).width(),c(r).height()),e.hold.sizer=a

'+t+"

"),i.toggleEditor(o,0,!0),wp.a11y.speak(t,"assertive")}).attr("src",ajaxurl+"?"+c.param(t))},action:function(i,t,e){var a,o,s,r,n=this;if(n.notsaved(i))return!1;if(t={action:"image-editor",_ajax_nonce:t,postid:i},"scale"===e){if(a=c("#imgedit-scale-width-"+i),o=c("#imgedit-scale-height-"+i),s=n.intval(a.val()),r=n.intval(o.val()),s<1)return a.trigger("focus"),!1;if(r<1)return o.trigger("focus"),!1;if(s===n.hold.ow||r===n.hold.oh)return!1;t.do="scale",t.fwidth=s,t.fheight=r}else{if("restore"!==e)return!1;t.do="restore"}n.toggleEditor(i,1),c.post(ajaxurl,t,function(t){c("#image-editor-"+i).empty().append(t.data.html),n.toggleEditor(i,0,!0),n._view&&n._view.refresh()}).done(function(t){t&&t.data.message.msg?wp.a11y.speak(t.data.message.msg):t&&t.data.message.error&&wp.a11y.speak(t.data.message.error)})},save:function(i,t){var e=this.getTarget(i),a=this.filterHistory(i,0),o=this;if(""===a)return!1;this.toggleEditor(i,1),t={action:"image-editor",_ajax_nonce:t,postid:i,history:a,target:e,context:c("#image-edit-context").length?c("#image-edit-context").val():null,do:"save"},c.post(ajaxurl,t,function(t){t.data.error?(c("#imgedit-response-"+i).html('"),l.close(i),wp.a11y.speak(t.data.error)):(t.data.fw&&t.data.fh&&c("#media-dims-"+i).html(t.data.fw+" × "+t.data.fh),t.data.thumbnail&&c(".thumbnail","#thumbnail-head-"+i).attr("src",""+t.data.thumbnail),t.data.msg&&(c("#imgedit-response-"+i).html('"),wp.a11y.speak(t.data.msg)),o._view?o._view.save():l.close(i))})},open:function(e,t,i){this._view=i;var a=c("#image-editor-"+e),o=c("#media-head-"+e),s=c("#imgedit-open-btn-"+e),r=s.siblings(".spinner");if(!s.hasClass("button-activated"))return r.addClass("is-active"),c.ajax({url:ajaxurl,type:"post",data:{action:"image-editor",_ajax_nonce:t,postid:e,do:"open"},beforeSend:function(){s.addClass("button-activated")}}).done(function(t){var i;"-1"===t&&(i=n("Could not load the preview image."),a.html('")),t.data&&t.data.html&&a.html(t.data.html),o.fadeOut("fast",function(){a.fadeIn("fast",function(){i&&c(document).trigger("image-editor-ui-ready")}),s.removeClass("button-activated"),r.removeClass("is-active")}),l.init(e)})},imgLoaded:function(t){var i=c("#image-preview-"+t),e=c("#imgedit-crop-"+t);void 0===this.hold.sizer&&this.init(t),this.initCrop(t,i,e),this.setCropSelection(t,{x1:0,y1:0,x2:0,y2:0,width:i.innerWidth(),height:i.innerHeight()}),this.toggleEditor(t,0,!0)},focusManager:function(){setTimeout(function(){var t=c('.notice[role="alert"]');(t=t.length?t:c(".imgedit-wrap").find(":tabbable:first")).trigger("focus")},100)},initCrop:function(a,t,i){var o=this,s=c("#imgedit-sel-width-"+a),r=c("#imgedit-sel-height-"+a),n=c("#imgedit-start-x-"+a),d=c("#imgedit-start-y-"+a),t=c(t);t.data("imgAreaSelect")||(o.iasapi=t.imgAreaSelect({parent:i,instance:!0,handles:!0,keys:!0,minWidth:3,minHeight:3,onInit:function(t){c(t).next().css("position","absolute").nextAll(".imgareaselect-outer").css("position","absolute"),i.children().on("mousedown, touchstart",function(t){var i,e=!1;t.shiftKey&&(t=o.iasapi.getSelection(),i=o.getSelRatio(a),e=t&&t.width&&t.height?t.width+":"+t.height:i),o.iasapi.setOptions({aspectRatio:e})})},onSelectStart:function(){l.setDisabled(c("#imgedit-crop-sel-"+a),1),l.setDisabled(c(".imgedit-crop-clear"),1),l.setDisabled(c(".imgedit-crop-apply"),1)},onSelectEnd:function(t,i){l.setCropSelection(a,i),c("#imgedit-crop > *").is(":visible")||l.toggleControls(c(".imgedit-crop.button"))},onSelectChange:function(t,i){var e=l.hold.sizer;s.val(l.round(i.width/e)),r.val(l.round(i.height/e)),n.val(l.round(i.x1/e)),d.val(l.round(i.y1/e))}}))},setCropSelection:function(t,i){if(!(i=i||0)||i.width<3&&i.height<3)return this.setDisabled(c(".imgedit-crop","#imgedit-panel-"+t),1),this.setDisabled(c("#imgedit-crop-sel-"+t),1),c("#imgedit-sel-width-"+t).val(""),c("#imgedit-sel-height-"+t).val(""),c("#imgedit-start-x-"+t).val("0"),c("#imgedit-start-y-"+t).val("0"),c("#imgedit-selection-"+t).val(""),!1;i={x:i.x1,y:i.y1,w:i.width,h:i.height},this.setDisabled(c(".imgedit-crop","#imgedit-panel-"+t),1),c("#imgedit-selection-"+t).val(JSON.stringify(i))},close:function(t,i){if((i=i||!1)&&this.notsaved(t))return!1;this.iasapi={},this.hold={},this._view?this._view.back():c("#image-editor-"+t).fadeOut("fast",function(){c("#media-head-"+t).fadeIn("fast",function(){c("#imgedit-open-btn-"+t).trigger("focus")}),c(this).empty()})},notsaved:function(t){var i=c("#imgedit-history-"+t).val(),i=""!==i?JSON.parse(i):[];return this.intval(c("#imgedit-undone-"+t).val())

'+o+"

"),wp.a11y.speak(o,"assertive"),c(i?"#imgedit-crop-height-"+t:"#imgedit-crop-width-"+t).val("")):void 0!==(s=c("#imgedit-crop-"+t).find(".notice-error"))&&s.remove(),this.iasapi.setSelection(e.x1,e.y1,e.x2,a),this.iasapi.update())},validateNumeric:function(t){if(!1===this.intval(c(t).val()))return c(t).val(""),!1}}}(jQuery); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index 64652cf141..cf9afa0539 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55934'; +$wp_version = '6.3-alpha-55935'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.