woocommerce_add_to_cart_fragments
The WooCommerce Compare Products LITE woocommerce add to cart fragments hook.
Description
Parameters (1)
- 0. $data (unknown)
- The data.
Usage
- To run the hook, copy the example below.
- $data = apply_filters( 'woocommerce_add_to_cart_fragments', $data );
- if ( !empty( $data ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the woocommerce_add_to_cart_fragments callback
- function filter_woocommerce_add_to_cart_fragments( $data ) {
- // make filter magic happen here...
- return $data;
- };
- // add the filter
- add_filter( 'woocommerce_add_to_cart_fragments', 'filter_woocommerce_add_to_cart_fragments', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'woocommerce_add_to_cart_fragments', 'filter_woocommerce_add_to_cart_fragments', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /classes/class-wc-compare-filter.php
- $data = apply_filters('woocommerce_add_to_cart_fragments', $data);