Automattic\WooCommerce\Internal\PushNotifications
PushNotifications::on_init
Loads the push notifications class.
Method of the class: PushNotifications{}
No Hooks.
Returns
null. Nothing (null).
Usage
$PushNotifications = new PushNotifications(); $PushNotifications->on_init(): void;
Changelog
| Since 10.6.0 | Introduced. |
PushNotifications::on_init() PushNotifications::on init code WC 10.9.1
public function on_init(): void {
if ( ! $this->should_be_enabled() ) {
return;
}
$this->register_post_types();
wc_get_container()->get( PendingNotificationStore::class )->register();
( new PushTokenRestController() )->register();
( new PushNotificationRestController() )->register();
( new NotificationPreferencesRestController() )->register();
( new NewOrderNotificationTrigger() )->register();
( new NewReviewNotificationTrigger() )->register();
( new StockNotificationTrigger() )->register();
( new StockNotificationRecoveryHandler() )->register();
wc_get_container()->get( NotificationProcessor::class )->register();
wc_get_container()->get( NotificationRetryHandler::class )->register();
}