WordPress.org

Make WordPress Core

Changeset 52073


Ignore:
Timestamp:
11/09/2021 02:59:44 PM (2 months ago)
Author:
adamsilverstein
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/controllers/library.js

    r48650 r52073  
    197197        // If uploading, we know the filename but not the mime type.
    198198        if ( attachment.get('uploading') ) {
    199             return /\.(jpe?g|png|gif)$/i.test( attachment.get('filename') );
     199            return /\.(jpe?g|png|gif|webp)$/i.test( attachment.get('filename') );
    200200        }
    201201
Note: See TracChangeset for help on using the changeset viewer.