Skip to main content

benecaster_setup_wizard_completed

Action Free

Fires once when the setup wizard is completed — specifically when POST /benecaster/v1/wizard/complete is called on the final wizard step. The wizard completion flag is written before the action fires, so any callback that checks it will see it as complete.

This is a Free hook. It does not fire on ordinary admin page loads — only on the single completion event. Use it to initialize add-on defaults scoped to the newly created show, send a welcome notification to the site owner, or trigger an external onboarding webhook. Guard with a $show_id === 0 check to handle the case where the wizard was exited before a show was created.

Parameters

Name Type Default Description
$show_id int Post ID of the show created during the wizard. `0` if no show was created (wizard exited early without completing the show name step).
$bridge_slug string Slug of the subscription plugin connected during the wizard (e.g. `'memberpress'`, `'restrict-content'`). Empty string if the user selected "I'll connect one later."

Examples

Seed defaults and branch on bridge type

add_action( 'benecaster_setup_wizard_completed', function (
    int    $show_id,
    string $bridge_slug
): void {
    if ( $show_id === 0 ) {
        return; // no show created — wizard exited early
    }

    // Seed a default setting for this add-on on the new show.
    update_post_meta( $show_id, '_my_addon_setting', 'default_value' );

    // Optionally branch on the connected bridge.
    if ( 'memberpress' === $bridge_slug ) {
        // MemberPress-specific initialization.
    }
}, 10, 2 );

Notes

Guard callbacks with if ( $show_id === 0 ) return; to avoid operating on a missing show — this happens when the wizard is exited before the show name step is completed. Common bridge slug values include memberpress, woocommerce-subscriptions, woocommerce-memberships, paid-memberships-pro, and restrict-content. Add-ons that register custom bridges via benecaster_setup_wizard_bridge_options produce their own slugs. benecaster_bridge_connected fires separately before this hook when the user connects a bridge during the wizard.

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