Skip to main content

benecaster_episode_video_url

Filter Free

Filters the video file URL used in the front-end player and episode page. Does not affect the RSS enclosure URL.

Return a URL string. Cast with (string) and output through esc_url() into the <video src> attribute, so a disallowed protocol becomes an empty attribute rather than an error.

Only runs when the episode already has a direct video URL — the branch is reached before the embed branch, and a callback cannot introduce a player where none was resolved. Returning '' emits a <video> element with an empty src, which browsers render as a broken player rather than hiding it.

Parameters

Name Type Default Description
$url string Video file URL
$episode_id int ID of the episode
$show_id int ID of the show

Returns: string

Example

add_filter( 'benecaster_episode_video_url', function( $url, $episode_id, $show_id ) {
    // Redirect the video URL to a Bunny CDN pull zone.
    return str_replace( 'https://origin.example.com/', 'https://pullzone.b-cdn.net/', $url );
}, 10, 3 );

Affects

  • Episode page player