Skip to content

Instantly share code, notes, and snippets.

@kwcjr
Created November 25, 2021 11:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwcjr/dee5a5c8e68c9f569558f483a3fa51ba to your computer and use it in GitHub Desktop.
Save kwcjr/dee5a5c8e68c9f569558f483a3fa51ba to your computer and use it in GitHub Desktop.
Purge LiteSpeed cache after updates.
/**
* Purge LiteSpeed Cache after updates.
*
* This snippet will check if LS plugin is activated & then Purge all Cache
* after any Core, Theme or Plugin Installation, Update or rollback.
*
* @snippetType: Execute on Child Sites
*/
function my_upgrade_function( $upgrader_object, $options ) {
// Purge all LS Cache.
if ( defined( 'LSCWP_V' )) {
do_action( 'litespeed_purge_all' );
}
}
add_action( 'upgrader_process_complete', 'my_upgrade_function',10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment