Front_End::filter_thumbnail_html( $html, $post_id )
Post featured image filter callback.
Description
Filter for the WP featured image to replace it with the video embed if option is enabled from the plugin Settings.
Parameters
- $html
-
(Required)
- $post_id
-
(Required)
Return
(mixed|void)
Source
File: includes/libs/front-end.class.php
public function filter_thumbnail_html( $html, $post_id ){ if( ! Helper::video_is_visible() ){ return $html; } $video = Helper::get_video_post( $post_id ); if( !$video->is_video() ){ return $html; } $options = $video->get_embed_options(); if( 'replace-featured-image' !== $options['video_position'] ){ return $html; } $video_container = Helper::embed_video( $video, [], false ); /** * Filter the embed code when option to replace featured image is on. * Filter is triggered when the option to embed videos in place of the featured image is activated. * * @param string $video_container The HTML element that will contrin the video embed. * @param Video_Post $video The \Vimeotheque\Video_Post post object. * @param string $thumbnail_html The featured image HTML code. */ return apply_filters( 'vimeotheque_enhanced_embed\embed_code', $video_container, $video, $html ); }