Problem
Hi, I need to set a custom trigger, send a notification after buttom clicked. I'm coding in function.php file of my child theme.
I tried to repeat the article https://www.smashingmagazine.com/2018/07/wordpress-notifications-made-easy and https://docs.bracketspace.com/notification/developer/triggers/custom-trigger documentation but get always the same error:
Uncaught Error: Class 'BracketSpace\Notification\Abstracts\Trigger' not found in SERVER_FOLDER/wp-content/themes/child/functions.php:777
referring the line:
class CustomTrigger extends \BracketSpace\Notification\Abstracts\Trigger {
I tried to declare so:
add_action( 'init', function() {
class CustomTrigger extends \BracketSpace\Notification\Abstracts\Trigger {
...
}
});
// Init the custom trigger class instance
add_action( 'init', function() {
notification_register_trigger( new CustomTrigger() );
}, 1100);
but does't work.
Thank you for your help.
Enzo
Problem
Hi, I need to set a custom trigger, send a notification after buttom clicked. I'm coding in function.php file of my child theme.
I tried to repeat the article https://www.smashingmagazine.com/2018/07/wordpress-notifications-made-easy and https://docs.bracketspace.com/notification/developer/triggers/custom-trigger documentation but get always the same error:
Uncaught Error: Class 'BracketSpace\Notification\Abstracts\Trigger' not found in SERVER_FOLDER/wp-content/themes/child/functions.php:777referring the line:
class CustomTrigger extends \BracketSpace\Notification\Abstracts\Trigger {I tried to declare so:
but does't work.
Thank you for your help.
Enzo