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) {
        $disabledSlugs = [
            'user/registered',
            'user/login',
        ];

        if (in_array($trigger->getSlug(), $disabledSlugs, true)) {
            return false;
        }

        return $enabled;
    },
    10,
    2
);

This filter was added in version 7.2.3.

Last updated