Filter since v1.0.0
fswa_should_dispatch
Controls whether a webhook should be dispatched for the current trigger event.
$
/ Signature
apply_filters( 'fswa_should_dispatch', $should, $trigger, $args )
/ When it fires
Fires before any delivery decision is made — before condition evaluation, queue insertion, or HTTP dispatch.
/ Parameters
| Name | In | Type | Req | Description |
|---|---|---|---|---|
| $should | param | bool | yes | Whether dispatch is currently allowed. Return `false` to suppress delivery. |
| $trigger | param | string | yes | The WordPress action/filter name that fired. |
| $args | param | array | yes | Arguments passed to the WordPress hook. |
/ Returns
bool Return `false` to cancel delivery. Return the original `$should` value to allow it./ Examples
Skip autosave and revision events
add_filter( 'fswa_should_dispatch', function ( $should, $trigger, $args ) { if ( $trigger === 'save_post' ) { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return false; $post_id = $args[0] ?? 0; if ( wp_is_post_revision( $post_id ) ) return false; } return $should; }, 10, 3 );
/ Related
Ready Stop losing webhooks.
Stop losing webhooks.
Start logging them.
$ wp plugin install flowsystems-webhook-actions --activate