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:
Andrew Ozz
2021-06-24 19:10:32 +00:00
parent f5ae410c33
commit 22bd19e9dd
5 changed files with 22 additions and 1 deletions

View File

@@ -2198,6 +2198,11 @@ function media_upload_form( $errors = null ) {
$plupload_init['multi_selection'] = false;
}
// Check if WebP images can be edited.
if ( ! wp_image_editor_supports( array( 'mime_type' => 'image/webp' ) ) ) {
$plupload_init['webp_upload_error'] = true;
}
/**
* Filters the default Plupload settings.
*