Automattic\WooCommerce\Internal\PushNotifications\Services

DriverAvailabilityService::read_disabled_filter │ private │ WC 1.0

Reads the disable filter.

Split out so the filter call, which runs arbitrary third-party callbacks, sits behind the same guard as every other foreign call in this class. It is reached on every request through {@see self::is_remote_proxy_available()}, so an escaping throwable here is a fatal on every page load rather than one bad endpoint response.

Метод класса: DriverAvailabilityService{}

Возвращает

bool.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->read_disabled_filter(): bool;

Код DriverAvailabilityService::read_disabled_filter() WC 11.2.2

private function read_disabled_filter(): bool {
	return ! wc_string_to_bool(
		/**
		 * Filters whether enhanced push notifications should be disabled.
		 *
		 * The feature was previously controlled by a now-deprecated feature
		 * flag. It is now enabled by default for all compatible users, but this
		 * filter lets a store force it off (e.g. to fall back to Jetpack Sync
		 * if something isn't working). The feature also requires a Jetpack
		 * connection, which is checked separately.
		 *
		 * @since 10.9.2
		 *
		 * @param bool $disabled Whether enhanced push notifications are disabled. Defaults to false.
		 */
		apply_filters( 'woocommerce_enhanced_push_notifications_disabled', false )
	);
}