mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-04 12:22:24 +08:00
https://github.com/StachRedeker/Automatic-Cache-Flusher-for-W3-Total-Cache#when-you-do-not-need-this-plugin
9 lines
399 B
Text
9 lines
399 B
Text
function w3tc_flush_on_plugin_update( $upgrader_object, $options ) {
|
|
if ( function_exists( 'w3tc_flush_all' ) ) {
|
|
w3tc_flush_all();
|
|
echo '<script>console.log("W3 Total Cache flushed.")</script>';
|
|
} else {
|
|
echo '<script>console.log("W3 Total Cache is not installed.")</script>';
|
|
}
|
|
}
|
|
add_action( 'upgrader_process_complete', 'w3tc_flush_on_plugin_update', 10, 2 );
|