Skip to content

Instantly share code, notes, and snippets.

@caercam
Created June 22, 2016 07:06
Show Gist options
  • Save caercam/89f186c706beb242b40cfef93c54a949 to your computer and use it in GitHub Desktop.
Save caercam/89f186c706beb242b40cfef93c54a949 to your computer and use it in GitHub Desktop.
Add 'MKV' and 'MP4' to supported WPMovieLibrary media types
<?php
/**
* Add new movie medias
*
* @param array Exisiting media
*
* @return array Updated media
*/
function wpmoly_add_new_media_type( $media ) {
$new_media = array(
'mkv' => 'MKV',
'mp4' => 'MP4'
);
$media = array_merge( $media, $new_media );
return $media;
}
add_filter( 'wpmoly_filter_detail_media', 'wpmoly_add_new_media_type', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment