mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Media: Prevent uploading and show an error message when the server doesn't support editing of WebP images, take II. Add new, better error message for it.
Props antpb, joedolson, iandunn, azaozz. Fixes #53475. git-svn-id: https://develop.svn.wordpress.org/trunk@51227 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+6
-1
@@ -604,7 +604,12 @@ jQuery( document ).ready( function( $ ) {
|
||||
plupload.each( files, function( file ) {
|
||||
if ( file.type === 'image/heic' && up.settings.heic_upload_error ) {
|
||||
// Show error but do not block uploading.
|
||||
wpQueueError( pluploadL10n.unsupported_image )
|
||||
wpQueueError( pluploadL10n.unsupported_image );
|
||||
} else if ( file.type === 'image/webp' && up.settings.webp_upload_error ) {
|
||||
// Disallow uploading of WebP images if the server cannot edit them.
|
||||
wpQueueError( pluploadL10n.noneditable_image );
|
||||
up.removeFile( file );
|
||||
return;
|
||||
}
|
||||
|
||||
fileQueued( file );
|
||||
|
||||
@@ -358,6 +358,11 @@ window.wp = window.wp || {};
|
||||
data: {},
|
||||
file: file
|
||||
});
|
||||
} else if ( file.type === 'image/webp' && up.settings.webp_upload_error ) {
|
||||
// Disallow uploading of WebP images if the server cannot edit them.
|
||||
error( pluploadL10n.noneditable_image, {}, file, 'no-retry' );
|
||||
up.removeFile( file );
|
||||
return;
|
||||
}
|
||||
|
||||
// Generate attributes for a new `Attachment` model.
|
||||
|
||||
Reference in New Issue
Block a user