Last active
December 21, 2024 02:51
-
-
Save mjones129/2e2c1a0d7268d7c3679ba93c24c4fe9a to your computer and use it in GitHub Desktop.
Add mime types to WordPress
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
/** | |
* Add new allowed media types | |
*/ | |
function mjt_add_mime_types( $wp_get_mime_types ) { | |
$wp_get_mime_types['webp'] = 'image/webp'; | |
$wp_get_mime_types['svg'] = 'image/svg+xml'; | |
$wp_get_mime_types['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; | |
$wp_get_mime_types['pdf'] = 'application/pdf'; | |
return $wp_get_mime_types; | |
} | |
add_filter( 'mime_types', 'mjt_add_mime_types' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment