Created
February 9, 2021 15:48
-
-
Save RobWiddick/e6774c757efcaef67e0dbfb9dafa2932 to your computer and use it in GitHub Desktop.
Clear All Pantheon & WP Caches 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
<?php | |
// Place snippet in functions.php | |
// Purge pantheon & wp cache on post save (not suggested for sites with high traffic) | |
add_action('save_post', function() { | |
if ( function_exists( 'pantheon_clear_edge_all' ) ) { | |
pantheon_clear_edge_all(); | |
} | |
wp_cache_flush(); | |
}, 1000, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment