From 4fa2895b24d14181276775aa6ba7e9da4ab3b99d Mon Sep 17 00:00:00 2001 From: GrigoreMihai Date: Tue, 28 May 2024 21:21:30 +0300 Subject: [PATCH] fix: added .ai files to allowed upload mime types --- inc/files.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inc/files.php b/inc/files.php index cd6c8ec2..484559ba 100644 --- a/inc/files.php +++ b/inc/files.php @@ -168,8 +168,13 @@ function ppom_upload_file() { $file_name = apply_filters( 'ppom_uploaded_filename', $file_name ); + $additional_mime_types = apply_filters( 'ppom_custom_allowed_mime_types', array( 'ai' => 'application/postscript' ) ); + + $allowed_mime_types = array_merge( get_allowed_mime_types(), $additional_mime_types ); + /* ========== Invalid File type checking ========== */ - $file_type = wp_check_filetype_and_ext( $file_dir_path . $file_name, $file_name ); + $file_type = wp_check_filetype_and_ext( $file_dir_path . $file_name, $file_name, $allowed_mime_types ); + $extension = $file_type['ext'];