Skip to content

Instantly share code, notes, and snippets.

@jbma
Created December 9, 2015 11:10
Show Gist options
  • Save jbma/5d7383d164a4898b7e27 to your computer and use it in GitHub Desktop.
Save jbma/5d7383d164a4898b7e27 to your computer and use it in GitHub Desktop.
<?php
function clear_rocket_woocommerce_thankyou( $order_id ) {
// code to retrieve the products id from the $order_id
// should return an array of ids of the orders names $products_id
//empty in this exemple
$products_id = array();
// clear Rocket cache for these files
foreach ($products_id as $product_id){
rocket_clean_post($product_id);
}
};
add_action( 'woocommerce_thankyou', 'clear_rocket_woocommerce_thankyou', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment