Description

Filter cvm_video_post_date is triggered before creating a new post from a Vimeo video import action. Allows modification of post publish date before actually creating the post.

Parameters

$post_date
(string)(required) The post date. Can be either the date retrieved from Vimeo (if option to import date is enabled) or the current date. The date format is 'Y-m-d H:i:s'

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

Change the date to current time if import is not set to be a theme import.

function modify_video_post_date( $post_date, $video, $import_as_theme_post ){
    if( !$import_as_theme_post ){
        $post_date = current_time('mysql');
    }
    return $post_date;
}
add_filter( 'cvm_video_post_date', 'modify_video_post_date', 10, 3 );

Related