Yoast\WP\SEO\MyYoast_Client\Infrastructure\Registration

Client_Registration::deregisterpublicYoast 1.0

Deletes the client registration from the server (RFC 7592 DELETE) and clears local data.

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

Хуков нет.

Возвращает

true|false. True if deleted or already not registered, false on network failure.

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

$Client_Registration = new Client_Registration();
$Client_Registration->deregister(): bool;

Код Client_Registration::deregister() Yoast 28.3

public function deregister(): bool {
	$credentials = $this->get_registered_client();
	if ( $credentials === null ) {
		return true;
	}

	$result = $this->http_client->authenticated_request(
		'DELETE',
		$credentials->get_registration_client_uri(),
		$credentials->get_registration_access_token(),
		Auth_Token_Type::BEARER,
		[ 'timeout' => 10 ],
	);

	$this->forget_registration();

	return ! $result->is_transport_failure();
}