Fire notification on WP native actions
-
Hi,
How can I create a trigger which will fire a notification on native WP actions like
wp_loaded
orinit
?I am following this article:
https://www.smashingmagazine.com/2018/07/wordpress-notifications-made-easy/But when I add something like this to my functions.php file, I do see a new trigger called “Outbid” in the wp-admin, but nothing is happening on wp_loaded:
class Outbid extends \BracketSpace\Notification\Abstracts\Trigger { public function __construct() { // Add slug and the title. parent::__construct( 'outbid', __( 'Outbid', 'outbid' ) ); // Hook to the action. $this->add_action( 'wp_loaded' ); } public function merge_tags() {} } register_trigger( new Outbid() );
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Fire notification on WP native actions’ is closed to new replies.