Last active
June 29, 2016 23:48
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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