Suppressing the Notification
Disable all the Carriers at once
This is the best approach if you have to test the specific Notification, instead of a single Carrier.
To do this, you should use the filter:
1
add_filter( 'notification/should_send', function( $should_send, $notification, $trigger ) {
2
3
if ( $something ) {
4
$should_send = false;
5
}
6
7
return $should_send;
8
9
}, 10, 3 );
Copied!
At this point, the Trigger doesn't executed the action() method so you cannot use the Merge Tags. If you rely on Merge Tags, suppress the Carrier instead.
Last modified 11d ago
Copy link