Show or hide content based on whether a subscriber owns a buy-up
Buy-ups are optional add-ons subscribers can purchase on top of their existing plan — things like transcripts, bonus content, or extended access — without upgrading to a higher tier. Use benecaster_user_has_buyup() to check whether the current subscriber owns a specific buy-up, then show or hide content in your template accordingly.
Using this helper rather than querying the database directly means your checks stay accurate as grant states change — active subscriptions, grace periods, and pending cancellations are all handled for you.
The example shows the pattern in a template override: render the premium block for subscribers who own the buy-up, and show an upsell shortcode to those who don’t.
Code
<?php
// Inside a theme template part (e.g. episode/single.php override).
if ( benecaster_user_has_buyup( 0, $transcripts_buyup_id, $show_id ) ) {
// Render the transcript download block.
echo do_shortcode( '[my_transcript_download episode="' . $episode_id . '"]' );
} else {
// Render the "Add transcripts to your plan" upsell.
echo do_shortcode( '[benecaster_buyup_upsell buyup="' . $transcripts_buyup_id . '"]' );
}