Skip to content

Instantly share code, notes, and snippets.

@BryanBarrera
Created June 6, 2016 16:07
Show Gist options
  • Select an option

  • Save BryanBarrera/6fcdcbde8fcc827565d7c6cce577d6c1 to your computer and use it in GitHub Desktop.

Select an option

Save BryanBarrera/6fcdcbde8fcc827565d7c6cce577d6c1 to your computer and use it in GitHub Desktop.
Allow Wordpress Media Library to upload SVG
<?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