• Resolved foxpc

    (@foxpc)


    Hi,
    how to clear the cache programmatically from code? i want to emulate the bar button that Clear the cached assets/js.

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author Gabe Livan

    (@gabelivan)

    @foxpc you can use the following snippet to clear Asset CleanUp’s caching outside the plugin (e.g. if you’re using another plugin and you want to clear Asset CleanUp’s caching after a certain action from the other plugin is taken):

    add_action('init', function() {
    if (method_exists('\WpAssetCleanUp\OptimiseAssets\OptimizeCommon', 'clearCache')) {
    \WpAssetCleanUp\OptimiseAssets\OptimizeCommon::clearCache();
    }
    }, PHP_INT_MAX);

    I hope it helps! Let me know if I can further assist you!

Viewing 1 replies (of 1 total)
  • The topic ‘clear the cache programmatically’ is closed to new replies.