woocommerce_file_download_path

The WooCommerce woocommerce file download path hook.

Description

apply_filters( 'woocommerce_file_download_path', (unknown) $value_file, (unknown) $product, (unknown) $key ); 

Parameters (3)

0. $value_file (unknown)
The value file.
1. $product (unknown)
The product.
2. $key (unknown)
The key.

Usage

To run the hook, copy the example below.
  1. $value_file = apply_filters( 'woocommerce_file_download_path', $value_file, $product, $key ); 
  2.  
  3. if ( !empty( $value_file ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_file_download_path callback 
  2. function filter_woocommerce_file_download_path( $value_file, $product, $key ) { 
  3. // make filter magic happen here... 
  4. return $value_file
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_file_download_path', 'filter_woocommerce_file_download_path', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_file_download_path', 'filter_woocommerce_file_download_path', 10, 3 ); 

Defined (5)

The filter is defined in the following location(s).

/includes/data-stores/class-wc-product-data-store-cpt.php  
  1. $download->set_file( apply_filters( 'woocommerce_file_download_path', $value['file'], $product, $key ) ); 
/includes/api/v1/class-wc-rest-products-controller.php  
  1. $download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) ); 
/includes/api/legacy/v3/class-wc-api-products.php  
  1. $download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) ); 
/includes/api/legacy/v2/class-wc-api-products.php  
  1. $download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) ); 
/includes/api/class-wc-rest-products-controller.php  
  1. $download->set_file( apply_filters( 'woocommerce_file_download_path', $file['file'], $product, $key ) );