Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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