Created
November 25, 2015 14:45
-
-
Save dededey/e992efee132773311fda to your computer and use it in GitHub Desktop.
add svg support to wordpress uploader
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
function cc_mime_types($mimes) { | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} | |
add_filter('upload_mimes', 'cc_mime_types'); | |
function fix_svg_thumb_display() { | |
echo ' | |
td.media-icon img[src$=".svg"], img[src$=".svg"].attachment-post-thumbnail { | |
width: 100% !important; | |
height: auto !important; | |
} | |
'; | |
} | |
add_action('admin_head', 'fix_svg_thumb_display'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment