Description

Filter that can be used to prevent (any) video importing.

Parameters

$import
(boolean)(required) Import video (true) or prevent it from being imported (false).

Default:True
$post_type
(string)(optional) The post type that will be created by the plugin if import is allowed.

Default:None
$video_details
(array)(optional) The details of the video (video ID, title, description, etc.) retrieved from Vimeo

Default:None
$import_as_theme_post
(boolean)(optional) If the WP theme is compatible with the plugin and the user has selected to import video as theme post, this variable will be set to (boolean)true.

Default:False

Examples

Do not import video if duration is less than 30 seconds.

function check_video_duration( $allow_import, $video ){
    if( $video['duration'] < 30 ){
        $allow_import= false;
    }
    return $allow_import;
}
add_filter( 'cvm_allow_video_import', 'check_video_duration', 10, 2 );

Related