Created
June 6, 2016 16:07
-
-
Save BryanBarrera/6fcdcbde8fcc827565d7c6cce577d6c1 to your computer and use it in GitHub Desktop.
Allow Wordpress Media Library to upload SVG
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 | |
| /** | |
| * Custom functions that act independently of the theme templates. | |
| * | |
| * Eventually, some of the functionality here could be replaced by core features. | |
| * | |
| * @package change_to_theme_name | |
| */ | |
| // @ Reference : https://css-tricks.com/snippets/wordpress/allow-svg-through-wordpress-media-uploader/ | |
| 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