Skip to content

Instantly share code, notes, and snippets.

@stefanolaru
Created December 7, 2015 09:02
Show Gist options
  • Save stefanolaru/623616f9abc5d5e12292 to your computer and use it in GitHub Desktop.
Save stefanolaru/623616f9abc5d5e12292 to your computer and use it in GitHub Desktop.
Flush W3 cache on post save
function clear_w3_cache($post_ID) {
if (function_exists('w3tc_flush_all')) {
w3tc_flush_all();
}
return $post_ID;
}
add_action('wp_insert_post_data', 'clear_w3_cache');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment