woocommerce_partial_download_tracking_window filter-hookWC 9.2.0

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

WC_Download_Handler::track_download()
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() ) );

Where the hook is used in WooCommerce

Usage not found.