Skip to main content

benecaster_subscribe_output

Filter Free

Filters the full rendered HTML output of the benecaster_subscribe shortcode after all tier cards are compiled. Use this filter to wrap the pricing section in a custom container, prepend or append supplementary content outside the cards, or replace the output entirely.

This filter fires on the complete output — all tier cards together. To inject content inside individual tier cards (between the tier name and price and the subscribe button), use the benecaster_subscribe_tier_content action instead.

$html can be empty, or a notice rather than a tier list. On built-in membership the filter now runs on every path through the shortcode. It used to return early without filtering when a show had no tiers to display, so a callback that unconditionally appends markup is now also called with an empty $html, and with the “Stripe is not connected” notice, which is new output for this filter. Check $html before appending if that matters.

Parameters

Name Type Default Description
$html string Full rendered shortcode output
$show_id int ID of the show
$atts array Resolved shortcode attributes

Returns: string

Examples

Prepend headline above tier cards

add_filter( 'benecaster_subscribe_output', function( $html, $show_id, $atts ) {
    // Prepend a headline above the tier cards.
    $headline = '<h2 class="subscribe-headline">Join the inner circle</h2>';
    return $headline . $html;
}, 10, 3 );

Append pricing disclaimer below cards

add_filter( 'benecaster_subscribe_output', function ( string $html, int $show_id, array $atts ): string {
    $note = '<p class="pricing-note">Prices in USD. Cancel any time.</p>';
    return $html . $note;
}, 10, 3 );

Affects

  • [benecaster_subscribe](/shortcodes/benecaster-subscribe/) shortcode