WC_Customer_Data_Store::delete( WC_Customer $customer, array $args = array() )

Deletes a customer from the database.


Description Description


Parameters Parameters

$customer

(Required) Customer object.

$args

(Optional) Array of args to pass to the delete method.

Default value: array()


Top ↑

Source Source

File: includes/data-stores/class-wc-customer-data-store.php

	public function delete( &$customer, $args = array() ) {
		if ( ! $customer->get_id() ) {
			return;
		}

		$args = wp_parse_args(
			$args,
			array(
				'reassign' => 0,
			)
		);

		$id = $customer->get_id();
		wp_delete_user( $id, $args['reassign'] );

		do_action( 'woocommerce_delete_customer', $id );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.