woocommerce_available_download_count

The WooCommerce woocommerce available download count hook.

Description

Parameters (2)

0. $span_class_woocommerce_count_count_sprintf_n_s_download_remaining_s_downloads_remaining_download_downloads_remaining_woocommerce_download_downloads_remaining_span — Optional. (string) => '' . sprintf( _n( '%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'woocommerce' ), $download['downloads_remaining'] ) . ' '
The span class woocommerce count count sprintf n s download remaining s downloads remaining download downloads remaining woocommerce download downloads remaining span.
1. $download (unknown)
The download.

Usage

To run the hook, copy the example below.
  1. $span_class_woocommerce_count_count_sprintf_n_s_download_remaining_s_downloads_remaining_download_downloads_remaining_woocommerce_download_downloads_remaining_span = apply_filters( 'woocommerce_available_download_count', $span_class_woocommerce_count_count_sprintf_n_s_download_remaining_s_downloads_remaining_download_downloads_remaining_woocommerce_download_downloads_remaining_span, $download ); 
  2.  
  3. if ( !empty( $span_class_woocommerce_count_count_sprintf_n_s_download_remaining_s_downloads_remaining_download_downloads_remaining_woocommerce_download_downloads_remaining_span ) ) { 
  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_count callback 
  2. function filter_woocommerce_available_download_count( $span_class_woocommerce_count_count_sprintf_n_s_download_remaining_s_downloads_remaining_download_downloads_remaining_woocommerce_download_downloads_remaining_span, $download ) { 
  3. // make filter magic happen here... 
  4. return $span_class_woocommerce_count_count_sprintf_n_s_download_remaining_s_downloads_remaining_download_downloads_remaining_woocommerce_download_downloads_remaining_span
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_available_download_count', 'filter_woocommerce_available_download_count', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_available_download_count', 'filter_woocommerce_available_download_count', 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_count', '<span class="woocommerce-Count count">' . sprintf( _n( '%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'woocommerce' ), $download['downloads_remaining'] ) . '</span> ', $download );