Created
January 11, 2014 13:39
-
-
Save bavington/8371042 to your computer and use it in GitHub Desktop.
Allow the upload of SVG files into the WordPress Media Library by adding the following code to your theme's functions.php file.
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
<?php | |
///////////////////////////////////////////////////////////////////////////////////// | |
////////// Allow SVGs to be uploaded via the Media Centre within WordPress ////////// | |
///////////////////////////////////////////////////////////////////////////////////// | |
function cc_mime_types( $mimes ){ | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} | |
add_filter( 'upload_mimes', 'cc_mime_types' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment