Skip to content

Instantly share code, notes, and snippets.

@cryptexvinci
Last active February 23, 2022 15:27
Show Gist options
  • Select an option

  • Save cryptexvinci/d51f0a5a182eae1d48a892bb20fab08a to your computer and use it in GitHub Desktop.

Select an option

Save cryptexvinci/d51f0a5a182eae1d48a892bb20fab08a to your computer and use it in GitHub Desktop.
Extend Ultimate Member File Upload types
<?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