Automattic\WooCommerce\Internal\CLI\Migrator\Commands
ResetCommand::__invoke
Resets (deletes) the credentials for a given platform.
OPTIONS
- [--platform=<platform>]
- The platform to reset credentials for. Defaults to
'shopify'.
EXAMPLES
wp wc migrate reset
Метод класса: ResetCommand{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ResetCommand = new ResetCommand(); $ResetCommand->__invoke( $args, $assoc_args );
- $args(массив) (обязательный)
- Positional arguments.
- $assoc_args(массив) (обязательный)
- Associative arguments.
Код ResetCommand::__invoke() ResetCommand:: invoke WC 11.1.0
public function __invoke( array $args, array $assoc_args ) {
// Resolve and validate the platform.
$platform = $this->platform_registry->resolve_platform( $assoc_args );
$platform_display_name = $this->platform_registry->get_platform_display_name( $platform );
if ( ! $this->credential_manager->has_credentials( $platform ) ) {
WP_CLI::warning( "No credentials found for '{$platform_display_name}' to reset." );
return;
}
$this->credential_manager->delete_credentials( $platform );
WP_CLI::success( "Credentials for the '{$platform_display_name}' platform have been cleared." );
}