woocommerce_update_user_last_active_threshold
Enables customization of the update frequency for user last active meta by adjusting the threshold from default to custom values. Note that a lower threshold results in more frequent database writes by Woo core and, if enabled, Analytics.
Usage
add_filter( 'woocommerce_update_user_last_active_threshold', 'wp_kama_woocommerce_update_user_last_active_threshold_filter' );
/**
* Function for `woocommerce_update_user_last_active_threshold` filter-hook.
*
* @param int $threshold The threshold in seconds to be applied (1 minute, 5 minutes and 0 for immediate update).
*
* @return int
*/
function wp_kama_woocommerce_update_user_last_active_threshold_filter( $threshold ){
// filter...
return $threshold;
}
- $threshold(int)
- The threshold in seconds to be applied (1 minute, 5 minutes and 0 for immediate update).
Changelog
| Since 10.7.0 | Introduced. |
Where the hook is called
woocommerce_update_user_last_active_threshold
woocommerce/includes/wc-user-functions.php 1116
$threshold = (int) apply_filters( 'woocommerce_update_user_last_active_threshold', $threshold );