Skip to main content

benecaster_after_episode_content_area

Action Free

Fires on the episode page straight after the content area, on every render: whether the visitor can access the episode or not, and whether or not the episode has body text or a teaser. Use it for anything that belongs under the show notes on every episode, such as a transcript or a sponsor credit.

Not benecaster_after_episode_content. That one wraps the content block and is skipped when the teaser or the full content is empty, so an episode with no body text, or a locked episode with no teaser, never fires it.

It fires for visitors who cannot access the episode too. Check $can_access before printing anything a locked visitor should not see. $can_access is the real access check, not the result of benecaster_show_episode_content, so a preview filter that unlocks the notes does not make it true. A theme that overrides episode/single.php must fire this action itself.

Parameters

Name Type Default Description
$episode_id int — ID of the episode
$show_id int — ID of the show
$user_tier string — Current visitor's tier slug, or an empty string when they have no tier
$can_access bool — Whether the visitor can access the episode

Example

add_action( 'benecaster_after_episode_content_area', function ( int $episode_id, int $show_id, string $user_tier, bool $can_access ): void {
    if ( ! $can_access ) {
        return;
    }
    $note = get_post_meta( $episode_id, 'my_sponsor_note', true );
    if ( $note !== '' ) {
        echo '<aside class="my-sponsor-note">' . esc_html( $note ) . '</aside>';
    }
}, 10, 4 );

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