WC_CLI_COM_Command::disconnect()public staticWC 1.0

OPTIONS

[--yes]
Do not prompt for confirmation.

EXAMPLES

# Disconnect from site.
$ wp wc com disconnect
# Disconnect without prompt for confirmation.
$ wp wc com disconnect --yes

{} Это метод класса: WC_CLI_COM_Command{}

Хуков нет.

Возвращает

null. Ничего.

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

$result = WC_CLI_COM_Command::disconnect( $args, $assoc_args );
$args(массив) (обязательный)
Positional arguments to include when calling the command.
$assoc_args(массив) (обязательный)
Associative arguments to include when calling the command.

Код WC_CLI_COM_Command::disconnect() WC 6.9.4

public static function disconnect( array $args, array $assoc_args ) {
	if ( ! WC_Helper::is_site_connected() ) {
		WP_CLI::error( 'Your store is not connected to WooCommerce.com. Run `wp wc com connect` command.' );
	}

	WP_CLI::confirm( 'Are you sure you want to disconnect your store from WooCommerce.com?', $assoc_args );
	WC_Helper::disconnect();
	WP_CLI::success( 'You have successfully disconnected your store from WooCommerce.com' );
}