Allow SVG Upload

Enables the Upload of .svg files to the media library

/**
 * Snippet Name: Allow SVG Upload
 * Snippet URL: https://www.wpcustoms.net/snippets/allow-svg-upload/
 */
  // Allow SVG Upload

add_filter('upload_mimes', 'custom_upload_mimes');

function custom_upload_mimes ( $existing_mimes=array() ) {
	// add the file extension to the array
	$existing_mimes['svg'] = 'mime/type';
	// call the modified list of extensions
	return $existing_mimes;
} 

0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x