Yoast\WP\SEO\Config
SEMrush_Client::request_tokens() public Yoast 1.0
Requests the access token and refresh token based on the passed code.
{} Это метод класса: SEMrush_Client{}
Хуков нет.
Возвращает
SEMrush_Token
. The requested tokens.
Использование
$SEMrush_Client = new SEMrush_Client(); $SEMrush_Client->request_tokens( $code );
- $code(строка) (обязательный)
- The code to send.
Код SEMrush_Client::request_tokens() SEMrush Client::request tokens Yoast 16.1.1
public function request_tokens( $code ) {
try {
$response = $this->provider
->getAccessToken(
'authorization_code',
[
'code' => $code,
]
);
$token = SEMrush_Token::from_response( $response );
return $this->store_token( $token );
} catch ( \Exception $exception ) {
throw new Authentication_Failed_Exception( $exception );
}
}