Automattic\WooCommerce\Internal\Abilities

AbilitiesTracking::is_a11n │ private static │ WC 1.0

Whether an Automattician made the call: signed in on WordPress.com, or through the Automattic proxy.

Only detectable on WordPress.com and Atomic; always false elsewhere.

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

Хуков нет.

Возвращает

bool.

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

$result = AbilitiesTracking::is_a11n(): bool;

Код AbilitiesTracking::is_a11n() WC 11.3.0

private static function is_a11n(): bool {
	if ( function_exists( 'is_automattician' ) && is_automattician() ) {
		return true;
	}
	if ( defined( 'AT_PROXIED_REQUEST' ) && AT_PROXIED_REQUEST ) {
		return true;
	}
	if ( function_exists( 'wpcom_is_proxied_request' ) ) {
		return (bool) wpcom_is_proxied_request();
	}
	if ( isset( $_SERVER['A8C_PROXIED_REQUEST'] ) && is_string( $_SERVER['A8C_PROXIED_REQUEST'] ) ) {
		return '1' === sanitize_text_field( wp_unslash( $_SERVER['A8C_PROXIED_REQUEST'] ) );
	}
	return defined( 'A8C_PROXIED_REQUEST' ) && A8C_PROXIED_REQUEST;
}