Automattic\WooCommerce\Internal\Admin\Schedulers
CustomersScheduler::delete
Delete a batch of customers.
Method of the class: CustomersScheduler{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = CustomersScheduler::delete( $batch_size );
- $batch_size(int) (required)
- Number of items to delete.
CustomersScheduler::delete() CustomersScheduler::delete code WC 10.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 );
}
}