Yoast\WP\SEO\Config

OAuth_Client::get_tokens()publicYoast 1.0

Gets the stored tokens and refreshes them if they've expired.

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

Хуков нет.

Возвращает

OAuth_Token. The stored tokens.

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

$OAuth_Client = new OAuth_Client();
$OAuth_Client->get_tokens();

Код OAuth_Client::get_tokens() Yoast 22.4

public function get_tokens() {
	if ( empty( $this->token ) ) {
		throw new Empty_Token_Exception();
	}

	if ( $this->token->has_expired() ) {
		$this->token = $this->refresh_tokens( $this->token );
	}

	return $this->token;
}