Skip to main content

benecaster_episode_embed_video

Filter Free

Filters the rendered HTML for the embedded video player on the episode page.

Return an HTML string. Cast with (string) and output through wp_kses_post().

wp_kses_post() strips <iframe> on most installs, which is what an embed code usually is. A third-party player embed returned here will often vanish silently. Allow the tag through wp_kses_allowed_html first, or override the episode/player.php template.

This filter only runs when there is already a non-empty embed — the branch is elseif ( $embed_video !== '' ), and a direct video URL takes priority over it. Returning markup from a callback cannot add a player where the episode has none.

Parameters

Name Type Default Description
$html string Rendered video player HTML
$episode_id int ID of the episode
$show_id int ID of the show

Returns: string

Example

add_filter( 'benecaster_episode_embed_video', function( $html, $episode_id, $show_id ) {
    // Add a playsinline attribute for mobile-friendly inline video playback.
    return str_replace( '<video ', '<video playsinline ', $html );
}, 10, 3 );

Affects

  • Episode page player