diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-includes/js/plupload/handlers.js --- a/wp/wp-includes/js/plupload/handlers.js Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-includes/js/plupload/handlers.js Fri Sep 05 18:40:08 2025 +0200 @@ -16,8 +16,8 @@ jQuery( '
' ) .attr( 'id', 'media-item-' + fileObj.id ) .addClass( 'child-of-' + postid ) - .append( '
0%
', - jQuery( '
' ).text( ' ' + fileObj.name ) ) + .append( jQuery( '
' ).text( ' ' + fileObj.name ), + '
0%
' ) .appendTo( jQuery( '#media-items' ) ); // Disable submit. @@ -380,8 +380,6 @@ // Clear the selection and move focus back to the trigger. event.clearSelection(); - // Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680 - triggerElement.trigger( 'focus' ); // Show success visual feedback. clearTimeout( successTimeout ); successElement.removeClass( 'hidden' ); @@ -399,7 +397,7 @@ var tryAgainCount = {}; var tryAgain; - $( '.media-upload-form' ).bind( 'click.uploader', function( e ) { + $( '.media-upload-form' ).on( 'click.uploader', function( e ) { var target = $( e.target ), tr, c; if ( target.is( 'input[type="radio"]' ) ) { // Remember the last used image size and alignment. @@ -557,7 +555,7 @@ uploader_init = function() { uploader = new plupload.Uploader( wpUploaderInit ); - $( '#image_resize' ).bind( 'change', function() { + $( '#image_resize' ).on( 'change', function() { var arg = $( this ).prop( 'checked' ); setResize( arg ); @@ -610,6 +608,11 @@ wpQueueError( pluploadL10n.noneditable_image ); up.removeFile( file ); return; + } else if ( file.type === 'image/avif' && up.settings.avif_upload_error ) { + // Disallow uploading of AVIF images if the server cannot edit them. + wpQueueError( pluploadL10n.noneditable_image ); + up.removeFile( file ); + return; } fileQueued( file );