Skip to main content

benecaster_subscribe_current_membership

Filter Premium

Filters the panel benecaster_subscribe shows a logged-in viewer who already has a plan or follows the show, in place of or above the tier cards. It is the supported place to add a link to your account page: Benecaster adds none, because that page is wherever you placed [benecaster_account].

Branch on $membership['state']: paid, free or follower. A free member and a follower still see every paid tier below the panel, because this page is how they upgrade, so a “manage your plan” link usually belongs on paid only. An add-on’s own listener type arrives already resolved to one of these three, so never compare against a raw token type.

Returning '' removes the panel. For a paid member that leaves nothing at all where the shortcode is, since no tier cards are shown to them.

Parameters

Name Type Default Description
$html string — The panel's HTML.
$membership array — `state` (`paid`, `free` or `follower`), `tier_slug`, and `label` (the plan's display name; may be empty).
$show_id int — ID of the show

Returns: string

Example

add_filter( 'benecaster_subscribe_current_membership', function ( string $html, array $membership, int $show_id ): string {
    if ( 'paid' !== $membership['state'] ) {
        return $html;
    }
    return $html . '<p><a href="/account/">Manage your plan</a></p>';
}, 10, 3 );

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