Skip to main content

benecaster_show_episode_content

Filter Free

Controls whether the episode page shows the full show notes or the teaser to the current visitor. Starts at whether they can access the episode. The sibling of benecaster_show_episode_player, with the same arguments — a preview add-on that unlocks the player can unlock the notes too, or a time-limited-access add-on can lock both.

Applied in templates/episode/single.php before the episode/content part renders. A theme that overrides single.php must apply it itself to keep the behaviour. It changes the WEBSITE only — the feed is gated separately.

Parameters

Name Type Default Description
$show_content bool — Whether to show full episode content to the current user
$episode_id int — ID of the episode
$user_id int|null — WordPress user ID; null if not logged in
$user_tier string|null — Current tier slug; null if user has no active tier

Returns: bool

Example

add_filter( 'benecaster_show_episode_content', function( $show_content, $episode_id, $user_id, $user_tier ) {
    // Grant content access to site admins regardless of tier.
    if ( $user_id && user_can( $user_id, 'manage_options' ) ) {
        return true;
    }
    return $show_content;
}, 10, 4 );

Notes

Free — it fires in the free product's template, beside its free sibling.

Need this built rather than just documented? See our services →