woocommerce_product_feed_chunk_size
Filters the number of products processed per chunk during feed generation.
Each chunk runs in its own Action Scheduler action and then schedules the next, keeping every run short enough to finish within Action Scheduler's failure period and the host's request timeout. Defaults to the effective chunk size, which starts large and shrinks if a run gets stuck.
Usage
add_filter( 'woocommerce_product_feed_chunk_size', 'wp_kama_woocommerce_product_feed_chunk_size_filter' );
/**
* Function for `woocommerce_product_feed_chunk_size` filter-hook.
*
* @param int $chunk_size The number of products to process per chunk.
*
* @return int
*/
function wp_kama_woocommerce_product_feed_chunk_size_filter( $chunk_size ){
// filter...
return $chunk_size;
}
- $chunk_size(int)
- The number of products to process per chunk.
Changelog
| Since 11.0.0 | Introduced. |
Where the hook is called
woocommerce_product_feed_chunk_size
woocommerce/src/Internal/ProductFeed/Integrations/POSCatalog/AsyncGenerator.php 380
$chunk_size = (int) apply_filters( 'woocommerce_product_feed_chunk_size', $this->get_effective_chunk_size( $option_key ) );