Last active
June 4, 2019 09:32
-
-
Save d0ky/7e9e25d051ba06f71d5ba5233bec3dc3 to your computer and use it in GitHub Desktop.
fast velocity minify empty cache on page save to support elementor
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 | |
/** | |
* Purge fvm cache on page save | |
*/ | |
add_action( 'save_post', 'purge_cache', 10,3 ); | |
function purge_cache( $post_id, $post, $update ) { | |
// Only set for post_type = page! | |
if ( 'page' !== $post->post_type ) { | |
return; | |
} | |
//PURGE CACHE | |
if ( is_plugin_active('fast-velocity-minify/fvm.php')) { | |
fvm_purge_all(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment