WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/22/2021 11:11:02 PM (4 months ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

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

    r51198 r51211  
    33013301    }
    33023302
     3303    // Add WebP if the server supports it.
     3304    unset( $t['webp'] );
     3305
     3306    if ( wp_image_editor_supports( array( 'mime_type' => 'image/webp' ) ) ) {
     3307        $t['webp'] = 'image/webp';
     3308    }
     3309
    33033310    /**
    33043311     * Filters list of allowed mime types and file extensions.
Note: See TracChangeset for help on using the changeset viewer.