Skip to main content

benecaster_episode_card_artwork

Filter Free

Filters the artwork URL used in each archive card image.

Return a URL string. Cast with (string) and output through esc_url().

Returning an empty string SHORT-CIRCUITS the whole artwork block — the template returns before emitting the wrapper <div> and its link, so there is no empty box left behind. This is the supported way to drop artwork from a card.

Parameters

Name Type Default Description
$url string Artwork URL for the episode card
$episode_id int ID of the episode
$show_id int ID of the show

Returns: string

Example

add_filter( 'benecaster_episode_card_artwork', function( $url, $episode_id, $show_id ) {
    // Fall back to the show artwork when the episode has no custom artwork.
    if ( ! $url ) {
        return get_post_meta( $show_id, '_benecaster_artwork_url', true );
    }
    return $url;
}, 10, 3 );

Affects

  • archive/episode-card/artwork.php template part