Support » Plugin: SG Optimizer » Cache emptied/flushed action hook

  • Resolved pirulee

    (@pirulee)


    I tried to look at the code to find an action hook I could use for when the plugin empties or flushes the cache.

    Do you have any? Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hey @pirulee

    No, we don’t have such action, but we will add in the next version.

    Meanwhile, you can manually add the following to wp-content/plugins/sg-cachepress/helpers/helpers.php

    
    function sg_cachepress_purge_cache( $url = false ) {
    	global $siteground_optimizer_helper;
    
    	$url = empty( $url ) ? get_home_url( '/' ) : $url;
    
    	do_action( 'siteground_optimizer_flush_cache', $url );
    
    	return $siteground_optimizer_helper->supercacher->purge_cache_request( $url );
    }
    

    I have added it to the dev version and once we release 5.2.1 it will included.

    Regards,
    Stanimir

    Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    I mean, replace the sg_cachepress_purge_cache function with the code above 🙂

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cache emptied/flushed action hook’ is closed to new replies.