Skip to main content

benecaster_episode_card_locked_message

Filter Free

Filters the locked state message shown on archive cards for episodes the current user cannot access.

Return a string. Cast with (string) and output through wp_kses_post(), so HTML is allowed here (post-level tags; <script> is stripped).

⚠ Note the contrast with benecaster_archive_no_results_message, which looks like the same kind of filter but is output through esc_html() — markup returned to that one becomes literal entities. The default differs by login state (Subscriber-only episode when logged in, Subscribe to listen when not), so a callback that ignores its first argument loses that distinction.

Parameters

Name Type Default Description
$message string Locked state message HTML 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_locked_message', function( $message, $episode_id, $show_id ) {
    // Replace the default locked message with a tier-specific prompt.
    $required_tier = get_post_meta( $episode_id, '_benecaster_tier_slug', true );
    if ( $required_tier ) {
        return '<span class="locked-badge">For ' . esc_html( $required_tier ) . ' subscribers</span>';
    }
    return $message;
}, 10, 3 );

Affects

  • archive/episode-card/locked.php template part