sample_button_class

The WooCommerce Sample sample button class hook.

Description

Parameters (1)

0. $single_add_to_cart_button_button_alt_single_add_sample_to_cart_button_btn_btn_default (string) => "single_add_to_cart_button button alt single_add_sample_to_cart_button btn btn-default"
The single add to cart button button alt single add sample to cart button btn btn default.

Usage

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

Defined (1)

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

/woocommerce-sample.php  
  1. <?php $btnclass = apply_filters('sample_button_class', "single_add_to_cart_button button alt single_add_sample_to_cart_button btn btn-default"); ?>