WC_API_Customers::delete_customer()
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() WC API Customers::delete customer code WC 8.6.1
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' ); }