Skip to content

Instantly share code, notes, and snippets.

@2ndkauboy
Created December 2, 2015 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2ndkauboy/52f1e9f297969bafd5a0 to your computer and use it in GitHub Desktop.
Save 2ndkauboy/52f1e9f297969bafd5a0 to your computer and use it in GitHub Desktop.
Enable the users of your blog to upload SVG files
<?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