woocommerce_product_recount_terms
Filter to allow/prevent recounting of terms as it could be expensive. A likely scenario for this is when bulk importing products. We could then prevent it from recounting per product but instead recount it once when import is done. Of course this means the import logic has to support this.
Usage
add_filter( 'woocommerce_product_recount_terms', 'wp_kama_woocommerce_product_recount_terms_filter' ); /** * Function for `woocommerce_product_recount_terms` filter-hook. * * @param bool $true * * @return bool */ function wp_kama_woocommerce_product_recount_terms_filter( $true ){ // filter... return $true; }
- $true(true|false)
- -
Changelog
Since 5.2 | Introduced. |
Where the hook is called
woocommerce_product_recount_terms
woocommerce/includes/wc-term-functions.php 404
if ( ! apply_filters( 'woocommerce_product_recount_terms', true ) ) {