Skip to content

Instantly share code, notes, and snippets.

@nicomollet
Created December 7, 2018 08:22
Show Gist options
  • Save nicomollet/4b6d4a8ee8c626f5df466a06d3c7c433 to your computer and use it in GitHub Desktop.
Save nicomollet/4b6d4a8ee8c626f5df466a06d3c7c433 to your computer and use it in GitHub Desktop.
WooCommerce Scheduled Sales: everyday, sales start, cache should be emptied (WP Rocket)
<?php
/**
* WooCommerce Scheduled Sales: everyday, sales start, cache should be emptied (WP Rocket)
*
* @since 1.0.9
*/
function woocommerce_scheduled_sales_empty_wprocket_cache(){
// Clear WP Rocket Cache (whole site)
if ( function_exists( 'rocket_clean_domain' ) ) {
rocket_clean_domain();
}
}
add_action( 'woocommerce_scheduled_sales', 'woocommerce_scheduled_sales_empty_wprocket_cache', 200 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment