Skip to main content

benecaster_subscription_cancellation_requested

Action Premium

Fires when a built-in membership subscriber requests to cancel their subscription through the native billing portal — immediately after the cancellation request is accepted. The subscriber retains feed access until the end of the current billing period. This is the cancellation-intent event; the terminal cancellation event, benecaster_subscription_cancelled, fires later when the billing period ends and the subscription is actually deleted.

This hook fires only for subscriber-initiated cancellations via the billing portal and only for built-in membership subscribers. If a subscription is cancelled through the Stripe Dashboard or programmatically with immediate effect, only benecaster_subscription_cancelled fires — this hook is not called.

Parameters

Name Type Default Description
$user_id int WordPress user ID
$show_id int ID of the show
$subscription_id string Stripe subscription ID

Examples

Enqueue win-back sequence on cancellation request

add_action( 'benecaster_subscription_cancellation_requested', function (
    int    $user_id,
    int    $show_id,
    string $stripe_subscription_id
): void {
    $email = get_userdata( $user_id )->user_email;
    my_crm_enqueue_sequence( $email, 'winback-24h', [ 'show_id' => $show_id ] );
}, 10, 3 );

Track cancellation intent in analytics

add_action( 'benecaster_subscription_cancellation_requested', function (
    int    $user_id,
    int    $show_id,
    string $stripe_subscription_id
): void {
    my_analytics_track( 'subscription_cancellation_requested', [
        'user_id' => $user_id,
        'show_id' => $show_id,
    ] );
}, 10, 3 );

Notes

Fires only for built-in membership subscribers. External bridge subscribers (MemberPress, WooCommerce Subscriptions, Restrict Content Pro, Paid Memberships Pro) do not trigger this action.

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