Created
September 30, 2018 07:34
-
-
Save finalwebsites/a40ae6134de7872d316a03bdf38f0025 to your computer and use it in GitHub Desktop.
Extra bestandstypen mogelijk maken voor de WordPress upload functie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: