Skip to content

Instantly share code, notes, and snippets.

@sheabunge
Forked from ocean90/svg.php
Last active December 15, 2015 15:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sheabunge/5279485 to your computer and use it in GitHub Desktop.
Save sheabunge/5279485 to your computer and use it in GitHub Desktop.
Allows you to upload SVG files through the WordPress media uploader.
<?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