Purge LiteSpeed Cache After Design Changes
Purges the whole LiteSpeed Cache when the Customizer, menus or widgets are saved, so header, footer and sidebar changes appear on every page right away.
Opens WPIDE on
Code
$wpide_purge = function () {
if ( defined( 'LSCWP_V' ) ) {
do_action( 'litespeed_purge_all' );
}
};
add_action( 'customize_save_after', $wpide_purge );
add_action( 'wp_update_nav_menu', $wpide_purge );
add_action( 'update_option_sidebars_widgets', $wpide_purge );
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.