Suppressing the Carrier
How to disable the Carrier process on the fly
To disable the whole Notification (all Carriers) it's better to use the notification/should_send filter.
If you want to suppress a specific Carrier you can do it like this:
1
add_action( 'notification/carrier/pre-send', function( $carrier, $trigger, $notification ) {
2
​
3
if ( $carrier->get_slug() == 'email' ) {
4
$carrier->suppress();
5
}
6
​
7
}, 10, 3 );
Copied!
You can target any Carrier or Trigger property in this action to test your conditions.
​
Last modified 11d ago
Copy link