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
Метод класса: 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 CLI COM Command::disconnect WC 9.8.1
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' ) ); }