Mirror Supporter Wall opt-in changes to an external CRM or audit log
Appearing on the Supporter Wall is a subscriber’s own decision, and it is a consent decision — they are agreeing to be shown publicly. If you keep that consent anywhere else, a CRM or an audit log, the two records need to stay in step, because the whole value of a consent record is that it is right.
benecaster_subscriber_wall_visible fires whenever a subscriber saves that preference, and says which way they set it.
It fires on every save, not only when the answer changes — a subscriber re-confirming a choice they had already made still produces an event. That is deliberate: for consent, “they said yes again on this date” is a fact worth recording, not a duplicate to discard. If your own system only wants genuine changes, compare against what you already hold before writing.
Code
<?php
add_action( 'benecaster_subscriber_wall_visible', function ( int $user_id, bool $visible ): void {
my_crm_set_field( $user_id, 'show_on_supporter_wall', $visible );
my_audit_log( sprintf(
'user=%d set supporter_wall_visible=%s',
$user_id,
$visible ? 'true' : 'false'
) );
}, 10, 2 );
Hooks Used
Need this built rather than just documented? See our services →