Skip to content

Instantly share code, notes, and snippets.

@d0ky
Last active June 4, 2019 09:32
Show Gist options
  • Save d0ky/7e9e25d051ba06f71d5ba5233bec3dc3 to your computer and use it in GitHub Desktop.
Save d0ky/7e9e25d051ba06f71d5ba5233bec3dc3 to your computer and use it in GitHub Desktop.
fast velocity minify empty cache on page save to support elementor
<?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