Skip to content

Instantly share code, notes, and snippets.

@finalwebsites
Created September 30, 2018 07: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 finalwebsites/a40ae6134de7872d316a03bdf38f0025 to your computer and use it in GitHub Desktop.
Save finalwebsites/a40ae6134de7872d316a03bdf38f0025 to your computer and use it in GitHub Desktop.
Extra bestandstypen mogelijk maken voor de WordPress upload functie
<?php
// Plaats deze code in het functions.php bestand van je WordPress (child) theme
// Let op, niet alle bestandstypes zijn veilig voor de uploadfunctie.
function fws_add_file_types_to_uploads($file_types){
$new_filetypes = array();
$new_filetypes['svg'] = 'image/svg+xml';
$new_filetypes['zip'] = 'application/zip';
$file_types = array_merge($file_types, $new_filetypes );
return $file_types;
}
add_action('upload_mimes', 'fws_add_file_types_to_uploads');
@finalwebsites
Copy link
Author

finalwebsites commented Sep 30, 2018

Via deze link van de WordPress handleiding vind je een lijst met de standaard bestandstypen die je kan uploaden:
https://codex.wordpress.org/Uploading_Files

De mime types voor extra extensies vind je hier:
https://www.freeformatter.com/mime-types-list.html

Lees meer over de mogelijkheden van de WordPress Mediabibliotheek:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment