Make WordPress Core


Ignore:
Timestamp:
05/04/2021 02:43:36 PM (3 years ago)
Author:
adamsilverstein
Message:

Images: enable WebP support.

Add support for uploading, editing and saving WebP images when supported by the server.

Add 'image/webp' to supported mime types. Correctly identify WebP images and sizes even when PHP doesn't support WebP. Resize uploaded WebP files (when supported) and use for front end markup.

Props markoheijne, blobfolio, Clorith, joemcgill, atjn, desrosj, spacedmonkey, marylauc, mikeschroder, hellofromtonya, flixos90.
Fixes #35725.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r50761 r50810  
    65406540    switch ( $type ) {
    65416541        case 'image':
    6542             $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
     6542            $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'webp' );
    65436543            return in_array( $ext, $image_exts, true );
    65446544
Note: See TracChangeset for help on using the changeset viewer.