Skip to main content

Add a custom bridge card to the wizard Subscription step

Premium Intermediate

Add-ons that provide a non-built-in subscription bridge inject their card into the wizard’s Subscription step. The slug must match the bridge’s get_plugin_slug() return value so POST /bridge/activate can resolve it. Only add entries when the underlying plugin is active — the wizard shows all returned options without its own detection step.

The array you receive always starts with core’s Built-in membership entry (benecaster_builtin), so append your card after it. The wizard shows Built-in first and removes its “Recommended” badge whenever another option, yours included, is present.

When to Use This

Use this recipe when your add-on:

  • Implements a BridgeInterface for a membership plugin not included in Benecaster (the four built-in bridges are MemberPress, WooCommerce Subscriptions, Paid Memberships Pro, and Restrict Content Pro)

  • Wants to appear in the wizard’s plugin picker alongside the built-in bridges

How It Works

The filter receives the array of cards the wizard is about to render. Append an entry with a slug and a name and your plugin appears as a card alongside the built-in ones.

Requirements

The slug must match BridgeInterface::get_plugin_slug(). When the podcaster selects this card and clicks Continue, the wizard calls POST /benecaster/v1/bridge/activate with { show_id, bridge_slug }. The bridge manager resolves this slug to a bridge instance — if the slug doesn’t match get_plugin_slug(), activation silently fails and no bridge is connected.

The bridge must be registered with BridgeManager. Call BridgeManager::register_bridge( $bridge_instance ) inside a benecaster_boot callback. Without registration, activate_bridge() cannot resolve your slug.

Always guard with a class or function existence check. The wizard displays every returned option without doing its own plugin detection. Return a card unconditionally and it appears even when the plugin isn’t installed — the podcaster selects it, activation silently fails, and they finish the wizard with no bridge connected.

The name field is the card label. Keep it short and matching how the plugin is normally referenced. The wizard renders it as plain text on the card.

Combine with a Wizard Step

To show a follow-up configuration step immediately after the Subscription step, use the benecaster_setup_wizard_steps filter — see Inject a Wizard Step from an Add-on.

Insert your step after the one with the subscription ID and give it the bridge_connected condition. Note that bridge_connected is set to true whenever any option is selected, not only yours — so a step gated on it alone appears for Built-in membership too. Check the selected bridge slug inside your step component if you need it to be yours specifically, or use external_bridge_connected if it should appear for any plugin except Built-in.

Related

Code

<?php
add_filter( 'benecaster_setup_wizard_bridge_options', function ( array $options ): array {
    if ( class_exists( 'MyMembershipPlugin' ) ) {
        $options[] = [
            'slug' => 'my-membership-plugin',
            'name' => 'My Membership Plugin',
        ];
    }
    return $options;
} );

View on GitHub →

Hooks Used

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