WP Webhooks / Docs / fswa_max_attempts
Filter since v1.1.0

fswa_max_attempts

Sets the maximum number of delivery attempts before a webhook is marked permanently failed.

$

/ Signature

apply_filters( 'fswa_max_attempts', $attempts, $webhook_id )

/ When it fires

Fires when a new queue job is created and before each retry to determine if more attempts remain.

/ Parameters

NameInTypeReqDescription
$attemptsparamintyesMax attempts. Default: `5`. Test webhooks always get 1.
$webhook_idparamintyesWebhook configuration ID.

/ Returns

int Maximum number of attempts. Minimum: 1.

/ Examples

Give critical webhooks more attempts

add_filter( 'fswa_max_attempts', function ( $attempts, $webhook_id ) {
    $critical = [ 12, 17 ]; // webhook IDs
    return in_array( $webhook_id, $critical, true ) ? 10 : $attempts;
}, 10, 2 );

/ Related

Ready

Stop losing webhooks.
Start logging them.

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