woocommerce_reset_variations_link

The WooCommerce woocommerce reset variations link hook.

Description

apply_filters( 'woocommerce_reset_variations_link', (string) $a_class_reset_variations_href_esc_html_clear_woocommerce_a ); 

Parameters (1)

0. $a_class_reset_variations_href_esc_html_clear_woocommerce_a — Optional. (string) => '' . esc_html__( 'Clear', 'woocommerce' ) . ''
The class reset variations href esc html clear woocommerce a.

Usage

To run the hook, copy the example below.
  1. $a_class_reset_variations_href_esc_html_clear_woocommerce_a = apply_filters( 'woocommerce_reset_variations_link', $a_class_reset_variations_href_esc_html_clear_woocommerce_a ); 
  2.  
  3. if ( !empty( $a_class_reset_variations_href_esc_html_clear_woocommerce_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_reset_variations_link callback 
  2. function filter_woocommerce_reset_variations_link( $a_class_reset_variations_href_esc_html_clear_woocommerce_a ) { 
  3. // make filter magic happen here... 
  4. return $a_class_reset_variations_href_esc_html_clear_woocommerce_a
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_reset_variations_link', 'filter_woocommerce_reset_variations_link', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_reset_variations_link', 'filter_woocommerce_reset_variations_link', 10, 1 ); 

Defined (1)

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

/templates/single-product/add-to-cart/variable.php  
  1. echo end( $attribute_keys ) === $attribute_name ? apply_filters( 'woocommerce_reset_variations_link', '<a class="reset_variations" href="#">' . esc_html__( 'Clear', 'woocommerce' ) . '</a>' ) : '';