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. Ничего (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 8.7.0

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

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