Skip to content

Instantly share code, notes, and snippets.

@cadros
cadros / gist:8e409be574698ace3c685c570be40d59
Created June 25, 2016 14:13
Busting WooCommerce mini-cart output cache on dev site
/**
* Add inline script to refresh the WooCommerce (widget) mini-cart output
* @see woocommerce\assets\js\frontend\cart-fragments.min.js
*/
function bust_woo_minicart_cache() {
// if( get_theme_mod('tired_of_hard_caching') ) :
wp_add_inline_script('my_script_handle', "<script type='text/javascript'> window.sessionStorage.setItem('wc_fragments', null)</script>" );
// endif