Yoast\WP\SEO\MyYoast_Client\User_Interface

Auth_Command::authorize_siteprivateYoast 1.0

Performs a client_credentials grant for a site-level token.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

// private - только в коде основоного (родительского) класса
$result = $this->authorize_site( $scopes, $format ): void;
$scopes(string[]) (обязательный)
The scopes to request.
$format(строка) (обязательный)
The output format.

Код Auth_Command::authorize_site() Yoast 27.7

private function authorize_site( array $scopes, string $format ): void {
	try {
		$token_set = $this->myyoast_client->get_site_token( $scopes );
	} catch ( Exception $e ) {
		WP_CLI::error( 'Site token request failed: ' . $e->getMessage() );
		return;
	}

	$this->output( $this->build_token_info( $token_set ), $format );

	WP_CLI::success( 'Site token obtained.' );
}