Last active
May 11, 2022 10:25
-
-
Save adczk/69d9151cde1ab2e415c8c7fc1afa2ece to your computer and use it in GitHub Desktop.
WPMU HOSTING Avada + Hummingbird Avada cache clear
This file contains hidden or 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 | |
| /* | |
| * 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