WC_CLI_COM_Command::disconnect()
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
Method of the class: WC_CLI_COM_Command{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = WC_CLI_COM_Command::disconnect( $args, $assoc_args );
- $args(array) (required)
- Positional arguments to include when calling the command.
- $assoc_args(array) (required)
- Associative arguments to include when calling the command.
WC_CLI_COM_Command::disconnect() WC CLI COM Command::disconnect code WC 9.4.2
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.', 'woocommerce' ) ); } WP_CLI::confirm( __( 'Are you sure you want to disconnect your store from WooCommerce.com?', 'woocommerce' ), $assoc_args ); WC_Helper::disconnect(); WP_CLI::success( __( 'You have successfully disconnected your store from WooCommerce.com', 'woocommerce' ) ); }