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

Allow WebP Files Upload

// Add WebP MIME type support function add_webp_mime_type($mime_types) { $mime_types[‘webp’] = ‘image/webp’; return $mime_types; } add_filter(‘upload_mimes’, ‘add_webp_mime_type’); // Enable WebP in the Media Library function enable_webp_upload($data, $file) { $file[‘ext’] = ‘webp’; return $data; } add_filter(‘wp_handle_upload_prefilter’, ‘enable_webp_upload’, 10, 2); // Enable…Continue reading