Created
May 10, 2023 17:48
-
-
Save CodeAdminDe/93faad7f598263b2ed5b43ab82a9e1fc to your computer and use it in GitHub Desktop.
Add WooCommerce up- and download mime type for DMG files
This file contains 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
// allow DMG file upload for WC | |
add_filter('upload_mimes', 'ith__allow_dmg_upload'); | |
function ith__allow_dmg_upload($mime_types){ | |
$mime_types['dmg'] = 'application/x-apple-diskimage'; | |
return $mime_types; | |
} | |
// allow DMG file download for WC | |
add_filter( 'woocommerce_file_download_allowed_mime_types', 'ith__add_dmg_mime_type' ); | |
function ith__add_dmg_mime_type( $mime_types ){ | |
$mime_types[] = 'application/x-apple-diskimage'; | |
return $mime_types; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment