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

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’);Continue reading

Allow ICO Files Upload

function custom_allow_ico_upload($mimes) { $allowed_mime_types = array( ‘ico’ => ‘image/x-icon’ ); // Merge the allowed MIME types with the existing list $mimes = array_merge($mimes, $allowed_mime_types); return $mimes; } add_filter(‘upload_mimes’, ‘custom_allow_ico_upload’); function custom_handle_ico_upload_errors($file, $uploaded_file) { if (!empty($file[‘type’]) && $file[‘type’] === ‘image/x-icon’ &&…Continue reading