woocommerce_use_xsendfile_for_remote
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_filter( 'woocommerce_use_xsendfile_for_remote', 'wp_kama_woocommerce_use_xsendfile_for_remote_filter' ); /** * Function for `woocommerce_use_xsendfile_for_remote` filter-hook. * * @param $false * * @return */ function wp_kama_woocommerce_use_xsendfile_for_remote_filter( $false ){ // filter... return $false; }
- $false
- -
Где вызывается хук
woocommerce_use_xsendfile_for_remote
woocommerce/includes/class-wc-download-handler.php 346
if ( $parsed_file_path['remote_file'] && ! apply_filters( 'woocommerce_use_xsendfile_for_remote', false ) ) {