Skip to main content

benecaster_is_member_sync()

Feed Token Free
benecaster_is_member_sync(): bool

Tells a synced member from a live signup. Sync existing members links people through the same path a signup takes, so benecaster_token_generated, benecaster_token_reactivated and benecaster_token_type_changed carry the same arguments for both.

Return Value

Type: bool

true while a Sync existing members token is being written, false otherwise.

Example

add_action( 'benecaster_token_generated', function ( int $token_id, int $user_id, int $show_id ): void {
    // Ask here and decide here: a queued job always hears false.
    if ( benecaster_is_member_sync() ) {
        return;
    }
    as_enqueue_async_action( 'my_addon_add_to_list', [ $user_id, $show_id ] );
}, 10, 3 );

Notes

Ask while the action is running, never later. It is true only during the token write, so a listener that queues work must ask first and decide there: a queued job always hears false.

It is false on benecaster_subscription_synced, which fires after the write. That action only fires for a sync, so it needs no check. Worked example: the recipe Treat synced members as existing members.

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