Skip to main content

benecaster_bridge_switched

Action Premium

Fires after the Bridge Switch Wizard completes successfully. By the time this hook fires, the new bridge’s tier mappings have been saved, the active bridge setting has been updated, and a post-switch warning notice has been published.

When $new_bridge_slug is benecaster_builtin (a show moving onto built-in membership), no tier mappings are saved: built-in membership needs none, and any sent with the switch are ignored. The switch, the notice and this hook happen as usual.

This hook does not fire when a bridge is connected for the first time — use benecaster_bridge_connected for that. It also does not fire when a bridge is cleared without selecting a replacement.

Parameters

Name Type Default Description
$show_id int — ID of the show
$old_bridge_slug string — Slug of the bridge that was replaced
$new_bridge_slug string — Slug of the newly active bridge

Examples

Clear cached bridge-specific data

add_action( 'benecaster_bridge_switched', function ( int $show_id, string $old_slug, string $new_slug ): void {
    delete_transient( "my_addon_bridge_cache_{$show_id}" );
}, 10, 3 );

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