benecaster_episode_card_title
Filters the episode title string rendered in each archive card.
Return a string. Cast with (string) and output through esc_html() inside the card’s link, so markup renders as literal entities. Returning '' leaves an empty but still clickable link rather than removing the card.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$title |
string |
— | Episode title for the archive card |
$episode_id |
int |
— | ID of the episode |
$show_id |
int |
— | ID of the show |
Returns:
string
Example
add_filter( 'benecaster_episode_card_title', function( $title, $episode_id, $show_id ) {
// Prefix bonus episodes with a label in the archive list.
$episode_type = get_post_meta( $episode_id, '_benecaster_episode_type', true );
if ( 'bonus' === $episode_type ) {
return '[Bonus] ' . $title;
}
return $title;
}, 10, 3 );
Affects
- archive/episode-card/title.php template part