woocommerce_file_download_method filter-hook . WC 4.5.0
Filter download method.
Usage
add_filter( 'woocommerce_file_download_method', 'filter_function_name_3718', 10, 3 ); function filter_function_name_3718( $method, $product_id, $file_path ){ // filter... return $method; }
- $method(string)
- Download method.
- $product_id(int)
- Product ID.
- $file_path(string)
- URL to file.
Changelog
Since 4.5.0 | Introduced. |
Where the hook is called
woocommerce_file_download_method
woocommerce/includes/class-wc-download-handler.php 228
$file_download_method = apply_filters( 'woocommerce_file_download_method', get_option( 'woocommerce_file_download_method', 'force' ), $product_id, $file_path );