Yoast\WP\SEO\MyYoast_Client\User_Interface

Auth_Command::refresh_statuspublicYoast 1.0

Refreshes the client registration status against the server.

Reads the current registration from the authorization server to confirm it is still valid and shows the registration metadata.

OPTIONS

[--format=<format>]
Output format.
--- default: table options:
  • table
  • json

EXAMPLES

wp yoast auth refresh-status
wp yoast auth refresh-status --format=json

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

Хуков нет.

Возвращает

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

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

$Auth_Command = new Auth_Command();
$Auth_Command->refresh_status( $args, $assoc_args ): void;
$args
.
По умолчанию: null
$assoc_args
.
По умолчанию: null

Код Auth_Command::refresh_status() Yoast 28.3

public function refresh_status( $args = null, $assoc_args = null ): void {
	if ( ! $this->myyoast_client->is_registered() ) {
		WP_CLI::error( 'Not registered. Run "wp yoast auth register" first.' );
	}

	try {
		$metadata = $this->myyoast_client->refresh_registration_status();
	} catch ( Exception $e ) {
		WP_CLI::error( 'Status refresh failed: ' . $e->getMessage() );
		return;
	}

	// Redact sensitive fields.
	unset( $metadata['registration_access_token'] );

	$this->output( $metadata, Utils\get_flag_value( $assoc_args, 'format', 'table' ) );

	WP_CLI::success( 'Registration is valid.' );
}