Automattic\WooCommerce\Internal\Ucp

UcpDiscovery::get_profile │ public │ WC 1.0

Build the discovery profile.

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

Хуков нет.

Возвращает

array.

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

$UcpDiscovery = new UcpDiscovery();
$UcpDiscovery->get_profile(): array;

Код UcpDiscovery::get_profile() WC 11.3.0

public function get_profile(): array {
	return array(
		'ucp'   => array(
			'version'      => UcpUtils::VERSION,
			'services'     => array(
				'dev.ucp.shopping' => array(
					array(
						'version'   => UcpUtils::VERSION,
						'transport' => 'rest',
						'endpoint'  => rest_url( 'wc/ucp/v1' ),
						'spec'      => 'https://ucp.dev/' . UcpUtils::VERSION . '/specification/overview',
						'schema'    => 'https://ucp.dev/' . UcpUtils::VERSION . '/services/shopping/rest.openapi.json',
					),
				),
			),
			'capabilities' => array_map(
				static function ( array $declaration ): array {
					return array( $declaration );
				},
				UcpUtils::capability_declarations()
			),
		),
		'links' => array(
			array(
				'rel'  => 'self',
				'href' => home_url( '/.well-known/ucp' ),
			),
		),
	);
}