Flush W3 Total Cache After Design Changes
Flushes all W3 Total Cache caches when the Customizer, menus or widgets are saved, so site-wide changes are visible straight away.
Opens WPIDE on
Code
$wpide_flush = function () {
if ( function_exists( 'w3tc_flush_all' ) ) {
w3tc_flush_all();
}
};
add_action( 'customize_save_after', $wpide_flush );
add_action( 'wp_update_nav_menu', $wpide_flush );
add_action( 'update_option_sidebars_widgets', $wpide_flush );
Notes
""
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.