Skip to content

Instantly share code, notes, and snippets.

@adczk
Last active May 11, 2022 10:25
Show Gist options
  • Select an option

  • Save adczk/69d9151cde1ab2e415c8c7fc1afa2ece to your computer and use it in GitHub Desktop.

Select an option

Save adczk/69d9151cde1ab2e415c8c7fc1afa2ece to your computer and use it in GitHub Desktop.
WPMU HOSTING Avada + Hummingbird Avada cache clear
<?php
/*
* MU PLUGIN
* for WPMU DEV Hosted sites with Avada (and Fusion Cache in general)
*
* fixes issue: posts that are added to site do not show up on homepage until all caches are cleared
*
* add this as MU plugin and make sure that Page Cache is active in HB and set to
* clear full cache when post/page is updated
*
*/
add_action( 'wphb_clear_cache_url', 'avada_hb_cache_flusher', 99 );
function avada_hb_cache_flusher() {
if ( class_exists( 'Fusion_Cache' ) ) {
$HB_clear = new Fusion_Cache();
$HB_clear->reset_all_caches();
wp_cache_flush();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment