Skip to content

Instantly share code, notes, and snippets.

@ivo-ivanov
Created October 9, 2019 16:12
Show Gist options
  • Save ivo-ivanov/2860c47be25b103a6b389336c7cb9866 to your computer and use it in GitHub Desktop.
Save ivo-ivanov/2860c47be25b103a6b389336c7cb9866 to your computer and use it in GitHub Desktop.
Enable .svg upload in WordPress Mediathek. #wordpress
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