woocommerce_partial_download_tracking_window
Determines how long the window of time is for tracking unique download attempts, in relation to partial (ranged) download requests.
Usage
add_filter( 'woocommerce_partial_download_tracking_window', 'wp_kama_woocommerce_partial_download_tracking_window_filter', 10, 2 ); /** * Function for `woocommerce_partial_download_tracking_window` filter-hook. * * @param int $window_in_seconds Non-negative number of seconds. * @param int $download_permission_id References the download permission being tracked. * * @return int */ function wp_kama_woocommerce_partial_download_tracking_window_filter( $window_in_seconds, $download_permission_id ){ // filter... return $window_in_seconds; }
- $window_in_seconds(int)
- Non-negative number of seconds.
Default: 1800 (30 minutes) - $download_permission_id(int)
- References the download permission being tracked.
Changelog
Since 9.2.0 | Introduced. |
Where the hook is called
woocommerce_partial_download_tracking_window
woocommerce/includes/class-wc-download-handler.php 748
$window = absint( apply_filters( 'woocommerce_partial_download_tracking_window', 30 * MINUTE_IN_SECONDS, $download->get_id() ) );