From 2b03226a5051f3e3be0e30d2af1e7431976a0e39 Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 2 Aug 2024 22:45:55 +0200 Subject: [PATCH] feat: allow Python file uploads Extended the MIME types to permit Python (.py) file uploads. This enhances flexibility for users needing to upload scripts via the media library. No other functionalities were altered. --- functions.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/functions.php b/functions.php index 5fa0c5a..14252b3 100644 --- a/functions.php +++ b/functions.php @@ -827,3 +827,9 @@ function handle_pdf_download() } } add_action('template_redirect', 'handle_pdf_download'); + +function allow_more_uploads($mime_types) { + $mime_types['py'] = 'text/x-python'; + return $mime_types; +} +add_filter('upload_mimes', 'allow_more_uploads'); \ No newline at end of file