Automattic\WooCommerce\Internal\PushNotifications
PushNotifications::should_be_enabled
Determines if local push notification functionality should be enabled. The module runs on the remote proxy driver, so it is enabled exactly when that driver can send (feature not disabled and Jetpack connected). Memoize the value so we only check once per request.
Метод класса: PushNotifications{}
Хуков нет.
Возвращает
bool.
Использование
$PushNotifications = new PushNotifications(); $PushNotifications->should_be_enabled(): bool;
Список изменений
| С версии 10.4.0 | Введена. |
Код PushNotifications::should_be_enabled() PushNotifications::should be enabled WC 11.3.0
public function should_be_enabled(): bool {
if ( null !== $this->enabled ) {
return $this->enabled;
}
$this->enabled = wc_get_container()->get( DriverAvailabilityService::class )->is_remote_proxy_available();
return $this->enabled;
}