Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ulziibat-n/2aabdf4678ab8101eda44531f2986020 to your computer and use it in GitHub Desktop.
Save ulziibat-n/2aabdf4678ab8101eda44531f2986020 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