Created
December 7, 2015 09:02
-
-
Save stefanolaru/623616f9abc5d5e12292 to your computer and use it in GitHub Desktop.
Flush W3 cache on post save
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
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