Skip to content

Instantly share code, notes, and snippets.

@prajwal-stha
Created October 1, 2016 10:04
Show Gist options
  • Select an option

  • Save prajwal-stha/d567fe87749ece2efb3d66a6702fe0b4 to your computer and use it in GitHub Desktop.

Select an option

Save prajwal-stha/d567fe87749ece2efb3d66a6702fe0b4 to your computer and use it in GitHub Desktop.
Adding the SVG Format to the Allowed File Types
//add SVG to allowed file uploads
function add_file_types_to_uploads($file_types){
$new_filetypes = array();
$new_filetypes['svg'] = 'image/svg+xml';
$file_types = array_merge($file_types, $new_filetypes );
return $file_types;
}
add_action('upload_mimes', 'add_file_types_to_uploads');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment