Automattic\WooCommerce\Api\Infrastructure

Principal::is_authenticatedpublicWC 1.0

Whether the underlying WP user is authenticated.

Convenience for $principal->user->ID > 0, the canonical anonymous marker in WordPress. Use this in authorize() / execute() bodies that need to distinguish anonymous from authenticated callers.

Method of the class: Principal{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Principal = new Principal();
$Principal->is_authenticated(): bool;

Principal::is_authenticated() code WC 10.9.1

public function is_authenticated(): bool {
	return $this->user->ID > 0;
}