Background Processing filter

Regardless of the setting in Dashboard you can enable or disable background processing for a particular Trigger with a simple filter. You can reference default Triggers here.

add_filter( 'notification/trigger/process_in_background', function( $enabled, $trigger ) {
	$disabled_trigger_slugs = [
		'user/registered',
		'user/login',
	];

	if ( in_array( $trigger->get_slug(), $disabled_trigger_slugs, true ) ) {
		return false;
	}

	return $enabled;
}, 10, 2 );

This filter was added in version 7.2.3.

Last updated