WC_API_Customers::delete_customer()publicWC 2.2

Delete a customer

Method of the class: WC_API_Customers{}

Hooks from the method

Return

Array|WP_Error.

Usage

$WC_API_Customers = new WC_API_Customers();
$WC_API_Customers->delete_customer( $id );
$id(int) (required)
the customer ID

Changelog

Since 2.2 Introduced.

WC_API_Customers::delete_customer() code WC 8.9.0

public function delete_customer( $id ) {

	// Validate the customer ID.
	$id = $this->validate_request( $id, 'customer', 'delete' );

	// Return the validate error.
	if ( is_wp_error( $id ) ) {
		return $id;
	}

	do_action( 'woocommerce_api_delete_customer', $id, $this );

	return $this->delete( $id, 'customer' );
}