Automattic\WooCommerce\Internal\Abilities

AbilitiesTracking::create_frame │ private │ WC 1.0

Create the record of an invocation, with the context it started in.

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

Хуков нет.

Возвращает

array{name: string, channel: string, rest_namespace: string, external_client: string, start: float, executing: bool}.

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

// private - только в коде основоного (родительского) класса
$result = $this->create_frame( $ability_name, $executing ): array;
$ability_name(строка) (обязательный)
The ability name.
$executing(true|false) (обязательный)
Whether execution already started.

Код AbilitiesTracking::create_frame() WC 11.3.0

private function create_frame( string $ability_name, bool $executing ): array {
	$channel = $this->get_channel();
	return array(
		'name'            => $ability_name,
		'channel'         => $channel,
		'rest_namespace'  => $this->get_rest_namespace(),
		// Resolved now: the request metadata it reads is gone once the REST request finishes.
		'external_client' => 'mcp' === $channel ? $this->get_external_client() : self::NONE,
		'start'           => microtime( true ),
		'executing'       => $executing,
	);
}