woocommerce_download_file_force
Fallback on force download method for remote files. This is because:
- xsendfile needs proxy configuration to work for remote files, which cannot be assumed to be available on most hosts.
- Force download method is more secure than redirect method if allow_url_fopen is enabled in php.ini.
Использование
add_action( 'woocommerce_download_file_force', 'wp_kama_woocommerce_download_file_force_action', 10, 2 ); /** * Function for `woocommerce_download_file_force` action-hook. * * @param $file_path * @param $filename * * @return void */ function wp_kama_woocommerce_download_file_force_action( $file_path, $filename ){ // action... }
- $file_path
- -
- $filename
- -
Где вызывается хук
woocommerce_download_file_force
woocommerce/includes/class-wc-download-handler.php 347
do_action( 'woocommerce_download_file_force', $file_path, $filename );
Где используется хук в WooCommerce
woocommerce/includes/class-wc-download-handler.php 27
add_action( 'woocommerce_download_file_force', array( __CLASS__, 'download_file_force' ), 10, 2 );