woocommerce_cached_widget_id

Get cached widget.

Description

apply_filters( 'woocommerce_cached_widget_id', (array) $this_widget_id ); 

Parameters (1)

0. $this_widget_id (array)
The this widget id.

Usage

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

Defined (3)

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

/includes/abstracts/abstract-wc-widget.php  
  1. $cache = wp_cache_get( apply_filters( 'woocommerce_cached_widget_id', $this->widget_id ), 'widget' ); 
  1. wp_cache_set( apply_filters( 'woocommerce_cached_widget_id', $this->widget_id ), array( $args['widget_id'] => $content ), 'widget' ); 
  1. wp_cache_delete( apply_filters( 'woocommerce_cached_widget_id', $this->widget_id ), 'widget' );