Forked from nicomollet/woocommerce-sales-empty-cache.php
Created
September 10, 2019 14:14
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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