benecaster_video_podcast_enhanced_get_episode_poster_url()
benecaster_video_podcast_enhanced_get_episode_poster_url( int $episode_id, string $size = 'full' ): string
The image an episode’s video shows before playback, for a theme or another add-on: the poster chosen on the episode editor’s Video tab, falling back to the episode’s artwork and then the show’s. See Get the image an episode’s video shows before playback.
Parameters
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
episode_id |
int |
— | Yes | The episode. |
size |
string |
'full' |
No | Any registered image size, for the poster chosen on the Video tab. The artwork fallback has one size only. |
Return Value
Type:
string
The poster chosen on the episode editor's Video tab, at $size; else the episode's artwork; else the show's; else ''. On a show where Video Podcast Enhanced is switched off, the artwork, as Benecaster's own video shows there (the poster is kept and counts again when the add-on is switched back on). '' for an id that is not an episode. The URL is raw: escape it with esc_url().
Example
$image = function_exists( 'benecaster_video_podcast_enhanced_get_episode_poster_url' )
? benecaster_video_podcast_enhanced_get_episode_poster_url( $episode_id, 'medium_large' )
: benecaster_get_episode_artwork( $episode_id );
if ( '' !== $image ) {
printf( '<img src="%s" alt="" loading="lazy">', esc_url( $image ) );
}
Hooks Fired
Notes
Defined whenever the add-on is active, even when it is switched off for every show, so it is safe to call
from a theme; check function_exists() only for a site that may not have the add-on. No access or status
check: decide yourself whether the visitor may see the episode.
Need this built rather than just documented? See our services →