Yoast\WP\SEO\MyYoast_Client\Application

MyYoast_Client::revoke_all_user_tokenspublicYoast 1.0

Revokes every user token across all resource buckets ("log out everywhere").

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

Хуков нет.

Возвращает

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

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

$MyYoast_Client = new MyYoast_Client();
$MyYoast_Client->revoke_all_user_tokens( $user_id ): void;
$user_id(int) (обязательный)
The WordPress user ID.

Код MyYoast_Client::revoke_all_user_tokens() Yoast 28.3

public function revoke_all_user_tokens( int $user_id ): void {
	$tokens = $this->user_token_storage->get_all( $user_id );
	foreach ( $tokens as $token_set ) {
		$this->revocation_handler->revoke( $token_set->get_access_token(), Token_Type_Hint::ACCESS_TOKEN );
		if ( $token_set->get_refresh_token() !== null ) {
			$this->revocation_handler->revoke( $token_set->get_refresh_token(), Token_Type_Hint::REFRESH_TOKEN );
		}
		$this->user_token_storage->delete( $user_id, $token_set->get_resource_indicator() );
	}
}