Yoast\WP\SEO\MyYoast_Client\Application

MyYoast_Client::exchange_authorization_codepublicYoast 1.0

Exchanges an authorization code for tokens and stores them for the user.

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

Хуков нет.

Возвращает

Token_Set. The obtained tokens.

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

$MyYoast_Client = new MyYoast_Client();
$MyYoast_Client->exchange_authorization_code( $user_id, $code, $state ): Token_Set;
$user_id(int) (обязательный)
The WordPress user ID.
$code(строка) (обязательный)
The authorization code.
$state(строка) (обязательный)
The state parameter from the callback.

Код MyYoast_Client::exchange_authorization_code() Yoast 27.7

public function exchange_authorization_code( int $user_id, string $code, string $state ): Token_Set {
	$token_set = $this->auth_code_handler->exchange_code( $user_id, $code, $state );
	$this->user_token_storage->store( $user_id, $token_set );
	return $token_set;
}