wcpbc_delete_product_transients

Clear all WCPBC transients cache for product data.

Description

wcpbc_delete_product_transients( (int) $post_id = 0 ); 

Parameters (1)

0. $post_id — Optional. (int)
The post id.

Usage

  1. if ( !function_exists( 'wcpbc_delete_product_transients' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-product-price-based-on-countries/includes/wcpbc-functions.php'; 
  3.  
  4. // The post id. 
  5. $post_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wcpbc_delete_product_transients($post_id); 
  9.  

Defined (1)

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

/includes/wcpbc-functions.php  
  1. function wcpbc_delete_product_transients( $post_id = 0 ) { 
  2.  
  3. $transients_to_clear = array( 
  4. 'wcpbc_products_onsale_' 
  5. ); 
  6.  
  7. foreach ( array_keys( WCPBC()->get_regions() ) as $region_key ) { 
  8. foreach ( $transients_to_clear as $transient ) { 
  9. delete_transient( $transient . $region_key );