Restrict File Type Upload
-
I’ve got a problem with a WordPress installation. For some reason, after I install WordPress, SVG files can be uploaded.
I tried to put the following code in functions.php but it restricts all file type uploads, and I want only SVG to be restricted.
require dirname( FILE ) . ‘/common/framework.php’;
function remove_mime_types($mimes) { unset($mimes[‘image/svg+xml’]);}add_filter(‘upload_mimes’, ‘remove_mime_types’);Can you help me with a code that will do the job for me and disables SVG uploads? Thank you.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Restrict File Type Upload’ is closed to new replies.