woocommerce_rest_allowed_image_mime_types
Returns image mime types users are allowed to upload via the API.
Usage
add_filter( 'woocommerce_rest_allowed_image_mime_types', 'wp_kama_woocommerce_rest_allowed_image_mime_types_filter' ); /** * Function for `woocommerce_rest_allowed_image_mime_types` filter-hook. * * @param $array * * @return */ function wp_kama_woocommerce_rest_allowed_image_mime_types_filter( $array ){ // filter... return $array; }
- $array
- -
Changelog
Since 2.6.4 | Introduced. |
Where the hook is called
woocommerce_rest_allowed_image_mime_types
woocommerce/includes/wc-rest-functions.php 48-59
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', ) );