Skip to main content

benecaster_webhook_payload

Filter Free Since v1.0.0

Filters the outbound webhook payload immediately before dispatch. Use to add fields a receiving system needs, or to remove fields you would rather not send to a third party.

Removing personal data here is a legitimate use — the payload is about to leave your server for an external endpoint, and this is the last point at which you control what it contains.

Parameters

Name Type Default Description
$payload array Payload about to be dispatched.
$event string Event name that triggered the webhook.

Returns: array

Examples

Strip subscriber email from outbound webhooks

add_filter( 'benecaster_webhook_payload', function ( array $payload, string $event ): array {
    unset( $payload['subscriber_email'] );
    return $payload;
}, 10, 2 );