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.
This commit is contained in:
Kumi 2024-08-02 22:45:55 +02:00
parent 9885d43548
commit 2b03226a50
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -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');