woocommerce_delete_expired_draft_orders_batch_size
Filters the number of draft orders deleted per batch during cleanup.
Increasing this value can help improve deletion throughput for high-volume or busy stores when the cleanup task cannot keep up with the draft orders backlog.
Usage
add_filter( 'woocommerce_delete_expired_draft_orders_batch_size', 'wp_kama_woocommerce_delete_expired_draft_orders_batch_size_filter' );
/**
* Function for `woocommerce_delete_expired_draft_orders_batch_size` filter-hook.
*
* @param int $batch_size Number of draft orders to delete per batch.
*
* @return int
*/
function wp_kama_woocommerce_delete_expired_draft_orders_batch_size_filter( $batch_size ){
// filter...
return $batch_size;
}
- $batch_size(int)
- Number of draft orders to delete per batch.
Default: 20
Changelog
| Since 10.7.0 | Introduced. |
Where the hook is called
woocommerce_delete_expired_draft_orders_batch_size
woocommerce/src/Blocks/Domain/Services/DraftOrders.php 190
$batch_size = max( 1, (int) apply_filters( 'woocommerce_delete_expired_draft_orders_batch_size', 20 ) );