WP Webhooks / Docs / fswa_webhook_data
Filter since v1.3.0

fswa_webhook_data

Filters webhook data before it is returned in REST API responses.

$

/ Signature

apply_filters( 'fswa_webhook_data', $data, $webhook_id )

/ When it fires

Fires when a webhook is fetched via the REST API (single webhook or list endpoint).

/ Parameters

NameInTypeReqDescription
$dataparamarrayyesSerialized webhook data array returned by the REST endpoint.
$webhook_idparamintyesWebhook configuration ID.

/ Returns

array Modified webhook data. Pro uses this to append per-webhook retry/backoff fields.

/ Examples

Append a custom computed field to webhook responses

add_filter( 'fswa_webhook_data', function ( $data, $webhook_id ) {
    $data['delivery_count'] = (int) get_option( "my_webhook_{$webhook_id}_count", 0 );
    return $data;
}, 10, 2 );

/ Related

Ready

Stop losing webhooks.
Start logging them.

$ wp plugin install flowsystems-webhook-actions --activate