shvsh > /home/1168859.cloudwaysapps.com/rcyqmhwrmv/public_html/docs/wp-content/plugins/ht-knowledge-base/ht-knowledge-base.php
shvsh > /home/1168859.cloudwaysapps.com/rcyqmhwrmv/public_html/docs/wp-content/plugins/ht-knowledge-base/ht-knowledge-base.php
shvsh > /home/1168859.cloudwaysapps.com/rcyqmhwrmv/public_html/docs/wp-content/plugins/ht-knowledge-base/ht-knowledge-base.php

Add class to ‘add to cart’ button

Description

apply_filters( 'cpb_add_to_cart_button_class',  $classes ); 

Parameters (1)

0. $classes (array) The array of classes which will be applied to add to cart button.

Usage

The following example is for adding a hook callback.

// define the cpb_add_to_cart_button_class callback 
function my_add_to_cart_button_class( $classes ) {
    // make filter magic happen here... 
    array_push( $classes, 'your-class' );   
    return $classes; 
}

// add the filter 
add_filter( 'cpb_add_to_cart_button_class', 'my_add_to_cart_button_class', 10, 1 );

To remove a hook callback, use the example below.

// remove the filter 
remove_filter( 'cpb_add_to_cart_button_class', 'my_add_to_cart_button_class', 10, 1 ); 

Defined (1)

The filter is defined in the above location.

File: custom-product-boxes/public/cpb-template-functions.php
Function: cpb_template_add_to_cart

Updated on March 23, 2021
shvsh > /home/1168859.cloudwaysapps.com/rcyqmhwrmv/public_html/docs/wp-content/plugins/ht-knowledge-base/ht-knowledge-base.php
shvsh > /home/1168859.cloudwaysapps.com/rcyqmhwrmv/public_html/docs/wp-content/plugins/ht-knowledge-base/ht-knowledge-base.php
shvsh > /home/1168859.cloudwaysapps.com/rcyqmhwrmv/public_html/docs/wp-content/plugins/ht-knowledge-base/ht-knowledge-base.php

Was this article helpful?

shvsh > /home/1168859.cloudwaysapps.com/rcyqmhwrmv/public_html/docs/wp-content/plugins/ht-knowledge-base/ht-knowledge-base.php
shvsh > /home/1168859.cloudwaysapps.com/rcyqmhwrmv/public_html/docs/wp-content/plugins/ht-knowledge-base/ht-knowledge-base.php

Related Articles