WC_API_Customers::delete_customer()publicWC 2.2

Delete a customer

Метод класса: WC_API_Customers{}

Хуки из метода

Возвращает

Массив|WP_Error.

Использование

$WC_API_Customers = new WC_API_Customers();
$WC_API_Customers->delete_customer( $id );
$id(int) (обязательный)
the customer ID

Список изменений

С версии 2.2 Введена.

Код WC_API_Customers::delete_customer() WC 8.7.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' );
}