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:
parent
0b45e56052
commit
e47027ff1f
|
@ -3451,7 +3451,7 @@ Library = wp.media.controller.State.extend(/** @lends wp.media.controller.Librar
|
||||||
isImageAttachment: function( attachment ) {
|
isImageAttachment: function( attachment ) {
|
||||||
// If uploading, we know the filename but not the mime type.
|
// If uploading, we know the filename but not the mime type.
|
||||||
if ( attachment.get('uploading') ) {
|
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';
|
return attachment.get('type') === 'image';
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue