woocommerce_available_download_link

The WooCommerce woocommerce available download link hook.

Description

apply_filters( 'woocommerce_available_download_link', (string) $a_href_esc_url_download_download_url_download_download_name_a, (unknown) $download ); 

Parameters (2)

0. $a_href_esc_url_download_download_url_download_download_name_a — Optional. (string) => '' . $download['download_name'] . ''
The href esc url download download url download download name a.
1. $download (unknown)
The download.

Usage

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

Defined (1)

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

/templates/myaccount/my-downloads.php  
  1. echo apply_filters( 'woocommerce_available_download_link', '<a href="' . esc_url( $download['download_url'] ) . '">' . $download['download_name'] . '</a>', $download );