Skip to main content

Run custom logic after the Promote-to-Bridge wizard finishes

Premium Intermediate

The Promote-to-Bridge wizard moves a show’s subscribers from one membership system to another. benecaster_bridge_promote_complete fires when it has finished, and reports how it went: how many subscribers were moved, how many were skipped, and how many failed.

It fires whether or not there were failures, and the show is switched over either way. There is no separate “it went wrong” event to wait for, so a callback that assumes success will happily run after a migration that half worked. Check the failure count and branch on it — a partial migration is the case worth catching, because those subscribers are the ones who will lose access without anyone noticing.

Separately, benecaster_promote_grace_expired fires per subscriber as each one’s grace period runs out — the point at which a subscriber who never completed setup on the new system actually loses their feed.

Code

<?php
add_action( 'benecaster_bridge_promote_complete', function ( int $show_id, string $target_slug, int $promoted, int $skipped, int $errors ): void {
    if ( $errors > 0 ) {
        error_log( sprintf(
            'Promote to %s on show %d had %d failed rows out of %d.',
            $target_slug, $show_id, $errors, $promoted + $errors
        ) );
    }
}, 10, 5 );

add_action( 'benecaster_promote_grace_expired', function ( int $user_id, int $show_id, string $tier_slug ): void {
    // Subscriber failed to re-authorize within the grace window — log to your CRM, etc.
}, 10, 3 );

View on GitHub →

Hooks Used

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