Skip to main content

benecaster_subscribe_tier_content

Action Premium

Fires inside each tier card rendered by [benecaster_subscribe] on a show using a membership plugin (MemberPress, WooCommerce Subscriptions, Paid Memberships Pro or Restrict Content Pro), after the price and Subscribe button Benecaster prints there. Use it to add a description, a feature list or a badge to particular tiers — check $tier_slug, or your output appears on every card.

Do not print a price or a button here. Benecaster prints both itself on a membership-plugin show — the plugin’s own price, and a link to the plugin’s signup page for the level — so a callback that adds its own prints a second one on every card. To restyle what Benecaster prints, use benecaster_subscribe_output.

The same slug can arrive twice. It fires once per card, and a tier with two membership levels mapped to it (a monthly and an annual, say) has two cards. $level_id tells them apart: register with 10, 4 to receive it and $plugin_slug. A callback registered with 10, 2 still works and simply doesn’t get them.

It never fires on a show using Benecaster’s built-in membership, whose cards are rendered separately; edit those tiers’ descriptions under Memberships → Tiers.

Parameters

Name Type Default Description
$tier_slug string — Slug of the tier whose card is currently rendering
$show_id int — ID of the show
$level_id string — The membership plugin's own ID for this card's level. An empty string on a card with no level (a tier you manage by hand).
$plugin_slug string — The plugin that level belongs to: `memberpress`, `woo-subscriptions`, `paid-memberships` or `restrict-content`. An empty string when `$level_id` is.

Examples

Add a one-line description to two tiers

add_action( 'benecaster_subscribe_tier_content', function ( string $slug, int $show_id ): void {
    $blurbs = [
        'supporter' => 'Ad-free episodes and a monthly bonus.',
        'patron'    => 'Everything in Supporter, plus early access.',
    ];
    if ( isset( $blurbs[ $slug ] ) ) {
        echo '<p class="benecaster-subscribe__description">' . esc_html( $blurbs[ $slug ] ) . '</p>';
    }
}, 10, 2 );

Affects

Need this built rather than just documented? See our services →