woocommerce_widget_cart_is_hidden

Output widget.

Description

apply_filters( 'woocommerce_widget_cart_is_hidden', (bool) $is_cart ); 

Parameters (1)

0. $is_cart (bool) => is_cart() || is_checkout()
The is cart.

Usage

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

Defined (1)

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

/includes/widgets/class-wc-widget-cart.php  
  1. if ( apply_filters( 'woocommerce_widget_cart_is_hidden', is_cart() || is_checkout() ) ) {