Created
December 2, 2015 22:34
-
-
Save 2ndkauboy/52f1e9f297969bafd5a0 to your computer and use it in GitHub Desktop.
Enable the users of your blog to upload SVG files
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 | |
* Description: Enable the users of your blog to upload SVG files | |
* Version: 1.0.0 | |
* Author: Bernhard Kau | |
* Author URI: https://kau-boys.de | |
* License: GPLv3 | |
* License URI: http://www.gnu.org/licenses/gpl-3.0 | |
*/ | |
function allow_svg_mime_types( $mimes ) { | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} | |
add_filter( 'upload_mimes', 'allow_svg_mime_types' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment