Add something below the show notes on every episode page, even when the notes are empty
Anything that belongs under the show notes on every episode, such as a sponsor credit or a transcript, needs a hook that fires on every episode page. This one does: Benecaster fires benecaster_after_episode_content_area straight after the content area on every render, whether the visitor can access the episode or not, and whether or not it has body text or a teaser.
Why not benecaster_after_episode_content
benecaster_after_episode_content wraps the content block, and is skipped when the teaser or the full content is empty. An episode with no body text, or a locked episode with no teaser, never fires it, so whatever you hang on it goes missing on exactly those episodes.
Check access yourself
The action fires for visitors who cannot access the episode too. $can_access is the real access check, so test it before printing anything a locked visitor should not see, as the example does. A theme that overrides the episode page template must fire the action itself.
Code
<?php
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 );
Hooks Used
Need this built rather than just documented? See our services →