Last active
February 23, 2022 15:27
-
-
Save cryptexvinci/d51f0a5a182eae1d48a892bb20fab08a to your computer and use it in GitHub Desktop.
Extend Ultimate Member File Upload types
This file contains hidden or 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 | |
| /** | |
| * Issue: Cannot upload video using file upload form fields – no mp4 option! | |
| * @since 2019-05-21 | |
| */ | |
| function um_add_more_allowed_file_types( $allowed_types ) { | |
| if( is_array( $allowed_types ) ) { | |
| $allowed_types = array_merge( array( | |
| '3gp' => '.3gp - 3GPP video', | |
| 'avi' => '.avi - AVI video', | |
| 'mkv' => '.mkv - Matroska video', | |
| 'mov' => '.mov - QuickTime video', | |
| 'mpg' => '.mpg - MPEG-1 video', | |
| 'mp4' => '.mp4 - MPEG-4 video', | |
| ), $allowed_types ); | |
| } | |
| return $allowed_types; | |
| } | |
| add_action( 'um_allowed_file_types', 'um_add_more_allowed_file_types' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment