Media: Add "webp" extension to wp.media.controller.Library `isImageAttachment`.

Add "webp" extension to a media extension check, fixing an issue where the last used media
link type was not used for WebP images.

Props almendron, desrosj, kallookoo.
Fixes #53917.


Built from https://develop.svn.wordpress.org/trunk@52073


git-svn-id: http://core.svn.wordpress.org/trunk@51665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Adam Silverstein 2021-11-09 15:01:00 +00:00
parent 0b45e56052
commit e47027ff1f
3 changed files with 3 additions and 3 deletions

View File

@ -3451,7 +3451,7 @@ Library = wp.media.controller.State.extend(/** @lends wp.media.controller.Librar
isImageAttachment: function( attachment ) {
// If uploading, we know the filename but not the mime type.
if ( attachment.get('uploading') ) {
return /\.(jpe?g|png|gif)$/i.test( attachment.get('filename') );
return /\.(jpe?g|png|gif|webp)$/i.test( attachment.get('filename') );
}
return attachment.get('type') === 'image';

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-52072';
$wp_version = '5.9-alpha-52073';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.