mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Media: Prevent uploading and show an error message when the server doesn't support editing of WebP files and image sub-sizes cannot be created.
Props adamsilverstein, desrosj, azaozz Fixes #53475 git-svn-id: https://develop.svn.wordpress.org/trunk@51211 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3300,6 +3300,13 @@ function get_allowed_mime_types( $user = null ) {
|
||||
unset( $t['htm|html'], $t['js'] );
|
||||
}
|
||||
|
||||
// Add WebP if the server supports it.
|
||||
unset( $t['webp'] );
|
||||
|
||||
if ( wp_image_editor_supports( array( 'mime_type' => 'image/webp' ) ) ) {
|
||||
$t['webp'] = 'image/webp';
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters list of allowed mime types and file extensions.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user