Automattic\WooCommerce\Internal\Admin\Schedulers

CustomersScheduler::delete()public staticWC 1.0

Delete a batch of customers.

Method of the class: CustomersScheduler{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = CustomersScheduler::delete( $batch_size );
$batch_size(int) (required)
Number of items to delete.

CustomersScheduler::delete() code WC 8.7.0

public static function delete( $batch_size ) {
	global $wpdb;

	$customer_ids = $wpdb->get_col(
		$wpdb->prepare(
			"SELECT customer_id FROM {$wpdb->prefix}wc_customer_lookup ORDER BY customer_id ASC LIMIT %d",
			$batch_size
		)
	);

	foreach ( $customer_ids as $customer_id ) {
		CustomersDataStore::delete_customer( $customer_id );
	}
}