Helper::embed_video( \WP_Post $post, array $options = array(), bool $echo = true )

Embed the video attached to a video post.


Parameters

$post

(Required) The WordPress post that has the video attached to it.

$options

(Optional) Any options passed manually or from block editor parameters.

Default value: array()

$echo

(Optional) Output the result (true) or not (false).

Default value: true


Return

(string|void) The HTML for the embed.


Source

File: includes/libs/helper.class.php

317public static function embed_video( $post, $options = [], $echo = true ){
318    $_post = self::get_video_post( $post );
319    if( !$_post->is_video() ){
320        return;
321    }
322 
323    $player = new Player\Player( $_post, $options );
324    return $player->get_output( $echo );
325}

Start your video site now!

Manage and coordinate your Vimeo channels, albums or videos with your WordPress website. Perfect fit for membership, portfolio, online courses or any type of video collection.

Get Vimeotheque PRO!