Skip to content

Instantly share code, notes, and snippets.

@jessepearson
Last active June 29, 2016 23:48
Show Gist options
  • Select an option

  • Save jessepearson/2a93c783f9c60fc785f35d7b68a1ce15 to your computer and use it in GitHub Desktop.

Select an option

Save jessepearson/2a93c783f9c60fc785f35d7b68a1ce15 to your computer and use it in GitHub Desktop.
This function will add zip files back to the allowed mime types WooCommerce can use
<?php // Only copy this line if needed
/**
* This function will add zip files back to the allowed mime types WooCommerce can use
*
* @param array $mimes The allowed mime types
* @return array The filtered allowed mime types
*/
function give_zip_back_to_wc( $mimes ) {
if ( ! isset( $mimes['zip'] ) || 'application/zip' != $mimes['zip'] ) {
$mimes['zip'] = 'application/zip';
}
return $mimes;
}
add_filter( 'woocommerce_downloadable_file_allowed_mime_types', 'give_zip_back_to_wc', 999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment