benecaster_upgrade_prompt_html
Filters the HTML of the tier upgrade prompt shown when content requires a higher tier. Use $show_id to scope changes to a single show.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$html |
string |
— | Upgrade prompt HTML |
$episode_id |
int |
— | ID of the episode |
$show_id |
int |
— | ID of the show |
$required_tier |
string |
— | Tier slug required |
$user_tier |
string |
— | Current user's tier slug; empty string when not subscribed |
Returns:
string
Example
add_filter( 'benecaster_upgrade_prompt_html', function( $html, $episode_id, $show_id, $required_tier, $user_tier ) {
// Inject the subscribe page URL into the upgrade prompt.
$subscribe_url = get_permalink( get_post_meta( $show_id, '_benecaster_subscribe_page_id', true ) );
if ( $subscribe_url ) {
$html .= '<p><a href="' . esc_url( $subscribe_url ) . '">View subscription options →</a></p>';
}
return $html;
}, 10, 5 );