Skip to content

Instantly share code, notes, and snippets.

@bogdan-mainwp
Created December 6, 2018 13:09
Show Gist options
  • Save bogdan-mainwp/4f7552fabe26c03a10cbcf69fb220356 to your computer and use it in GitHub Desktop.
Save bogdan-mainwp/4f7552fabe26c03a10cbcf69fb220356 to your computer and use it in GitHub Desktop.
Custom code snippet for clearing SG Optimizer cache on child sites
<?php
// Use this snippet in the MainWP Code Snippets Extension (https://mainwp.com/extension/code-snippets/)
// Snippet Type: This Code Snippet only returns information from Child Site
if ( function_exists( 'sg_cachepress_purge_cache' ) ) {
sg_cachepress_purge_cache();
echo "Cache cleared successfully!";
} else {
echo "Clearing cache failed!";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment