Skip to content

Instantly share code, notes, and snippets.

@stuartduff
Last active February 17, 2024 20:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuartduff/9188b5b904bf66b4b98e724b457fa91a to your computer and use it in GitHub Desktop.
Save stuartduff/9188b5b904bf66b4b98e724b457fa91a to your computer and use it in GitHub Desktop.
Add webp MIME to be supported with the default WooCommerce Product Importer
function add_additonal_wc_mime_types($mime_types) {
$mime_types['webp'] = 'image/webp'; // Add support for webp images in the WooCommerce Product importer.
return $mime_types;
}
add_filter('woocommerce_rest_allowed_image_mime_types', 'add_additonal_wc_mime_types', 1, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment