Created
May 20, 2021 13:43
-
-
Save codename065/3a0d439ddc3d7b82f7d9fa13b2623a05 to your computer and use it in GitHub Desktop.
Introduce new file type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter("wp_check_filetype_and_ext", function ($mime_type, $file, $filename, $mimes, $real_mime){ | |
$ext = pathinfo($filename, PATHINFO_EXTENSION); | |
$ext = strtolower($ext); | |
if($ext === 'gpg') | |
return ['ext' => 'gpg', 'type' => 'application/gpg', 'proper_filename' => $filename ]; | |
}, 10, 5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment