woocommerce_downloadable_product_name

The WooCommerce woocommerce downloadable product name hook.

Description

apply_filters( 'woocommerce_downloadable_product_name', (string) $product_get_name_ndash_download_file_name, (unknown) $product, (unknown) $result_download_id, (number) $file_number ); 

Parameters (4)

0. $product_get_name_ndash_download_file_name (string)
The product get name ndash download file name.
1. $product (unknown)
The product.
2. $result_download_id (unknown)
The result download id.
3. $file_number (number)
The file number.

Usage

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

Defined (1)

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

/includes/wc-user-functions.php  
  1. $download_name = apply_filters(