Skip to main content

benecaster_subscriber_wall_visible

Action Free

Fires after a subscriber’s Supporter Wall opt-in flag is saved. The action fires after every write to the visibility setting — including same-value writes. If a subscriber is already opted in and submits the form again, the action fires again with `$visible = true`. This is intentional: listeners auditing consent re-confirmation events (such as GDPR consent logs) should see every explicit save, not only state transitions.

The action fires after the subscriber’s wall-visibility user meta is written, so reading the meta inside your callback reflects the new state. If you need transition-only behavior — firing only when the state actually changes — read the stored value before the update and compare it inside your callback.

Examples

Invalidate page cache and sync to CRM

add_action( 'benecaster_subscriber_wall_visible', function ( int $user_id, bool $visible ): void {
    // Invalidate the Supporter Wall page cache.
    if ( function_exists( 'rocket_clean_domain' ) ) {
        rocket_clean_domain();
    }

    // Sync to external CRM.
    my_crm_update_consent( $user_id, 'supporter_wall', $visible );
}, 10, 2 );