benecaster_episode_content
Filters the full page content for an episode.
Return the content string. Cast with (string).
This filter fires in the RSS feed and on the website. It runs in FeedCompiler and in ContentNamespace (which builds <content:encoded>) and in templates/episode/content.php — always with three arguments since 2026-09-18 (operator ruling; the feed used to pass two). The third, $tier_slug, is the tier the content is rendered for: the feed tier being compiled, or on the website the visitor’s tier (empty when they have none). A callback written for the website alone will change what subscribers’ podcast apps download — check the context if that matters.
In the feed, the tier gate resolves AFTER this filter, deliberately — so a gate a callback injects is resolved for that tier too, rather than being emitted as raw shortcode text. On the website, the_content runs after this filter, so blocks and shortcodes a callback adds are still processed.
Core itself registers here: Listener Support injects its inline prompt at priority 20. Returning a wholly new string rather than modifying the argument discards that injection.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$content |
string |
— | Episode post_content |
$episode_id |
int |
— | ID of the episode |
$tier_slug |
string |
— | The tier this content is rendered for: the feed tier being compiled, or on the website the visitor's tier (empty when they have none) |
Returns:
string
Example
add_filter( 'benecaster_episode_content', function( $content, $episode_id ) {
// Wrap episode content with a sponsor disclosure block.
$sponsor = get_post_meta( $episode_id, '_episode_sponsor', true );
if ( $sponsor ) {
$disclosure = '<p class="sponsor-disclosure">This episode is sponsored by ' . esc_html( $sponsor ) . '.</p>';
$content = $disclosure . $content;
}
return $content;
}, 10, 2 );