Updated WebP section in wc-core-functions.php

Removed, previously added, unnecessary filter, and already existing function in wc-rest-functions.php.
This commit is contained in:
Anastasio 2023-03-21 22:40:03 +02:00 committed by GitHub
parent 0661e1c2a8
commit f2cd586b22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 16 deletions

View File

@ -2589,24 +2589,8 @@ function wc_cache_get_multiple( $keys, $group = '', $force = false ) {
*
* WebP files should be able to be imported in WooCommerce, as they've been supported in WordPress core since v5.8.
*/
add_filter( 'woocommerce_rest_allowed_image_mime_types', 'more_mimes_to_exts' );
function more_mimes_to_exts( $mime_to_ext ){
$mime_to_ext['webp'] = 'image/webp';
return $mime_to_ext;
}
function wc_rest_allowed_image_mime_types() {
return apply_filters(
'woocommerce_rest_allowed_image_mime_types',
array(
'jpg|jpeg|jpe' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
'bmp' => 'image/bmp',
'tiff|tif' => 'image/tiff',
'ico' => 'image/x-icon',
'webp' => 'image/webp',
)
);
}