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:
parent
0661e1c2a8
commit
f2cd586b22
|
@ -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.
|
* 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 ){
|
function more_mimes_to_exts( $mime_to_ext ){
|
||||||
$mime_to_ext['webp'] = 'image/webp';
|
$mime_to_ext['webp'] = 'image/webp';
|
||||||
|
|
||||||
return $mime_to_ext;
|
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',
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue