Home / Attachments / Allow SVG/JPEG/WEBP/ICO/AVIF Files Upload
Duplicate Snippet

Embed Snippet on Your Site

Allow SVG/JPEG/WEBP/ICO/AVIF Files Upload

Allows these filetypes to be uploaded to the media library

Code Preview
php
<?php
function allow_additional_mime_types($mime_types) {
    $mime_types['jpeg'] = 'image/jpeg';
	$mime_types['svg']  = 'image/svg+xml';
    $mime_types['webp'] = 'image/webp';
	$mime_types['avif'] = 'image/avif';
    $mime_types['ico']  = 'image/vnd.microsoft.icon';
    return $mime_types;
}
add_filter('upload_mimes', 'allow_additional_mime_types');

Comments

Add a Comment