-
-
Save sheabunge/5279485 to your computer and use it in GitHub Desktop.
Allows you to upload SVG files through the WordPress media uploader.
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 | |
/** | |
* Plugin Name: Allow SVG Uploads | |
* Plugin URI: http://wordpress.stackexchange.com/q/94003/19726 | |
* Description: Allows you to upload SVG files through the WordPress media uploader. | |
* Author: Shea Bunge | |
* Author URI: http://bungeshea.com | |
* Version: 1.0 | |
*/ | |
function allow_svg_upload_mimes( $mimes ) { | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} | |
add_filter( 'upload_mimes', 'allow_svg_upload_mimes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment