Created
November 25, 2021 11:47
-
-
Save kwcjr/dee5a5c8e68c9f569558f483a3fa51ba to your computer and use it in GitHub Desktop.
Purge LiteSpeed cache after updates.
This file contains 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
/** | |
* 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