woocommerce_regenerate_variation_summaries_sync_threshold
Filters the threshold for synchronous regeneration of variation attribute summaries. If the number of variations affected by an update is below this threshold, the summaries are regenerated synchronously. Otherwise, the regeneration is scheduled asynchronously.
Использование
add_filter( 'woocommerce_regenerate_variation_summaries_sync_threshold', 'wp_kama_woocommerce_regenerate_variation_summaries_sync_threshold_filter' );
/**
* Function for `woocommerce_regenerate_variation_summaries_sync_threshold` filter-hook.
*
* @param int $threshold The default threshold value (50).
*
* @return int
*/
function wp_kama_woocommerce_regenerate_variation_summaries_sync_threshold_filter( $threshold ){
// filter...
return $threshold;
}
- $threshold(int)
- The default threshold value (50).
Список изменений
| С версии 10.2.0 | Введена. |
Где вызывается хук
woocommerce_regenerate_variation_summaries_sync_threshold
woocommerce/includes/class-wc-post-data.php 869
return absint( apply_filters( 'woocommerce_regenerate_variation_summaries_sync_threshold', 50 ) );