benecaster_teaser_content
Filters the teaser content shown to non-subscribers in place of the full episode content.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$teaser |
string |
— | Teaser content HTML |
$episode_id |
int |
— | ID of the episode |
$user_tier |
string|null |
— | Current user's tier slug; null if not subscribed |
Returns:
string
Example
add_filter( 'benecaster_teaser_content', function( $teaser, $episode_id, $user_tier ) {
// Replace the default teaser with the episode excerpt for non-subscribers.
if ( null === $user_tier ) {
$excerpt = get_post_field( 'post_excerpt', $episode_id );
if ( $excerpt ) {
return '<p>' . esc_html( $excerpt ) . '</p>';
}
}
return $teaser;
}, 10, 3 );