Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35162
    Celine celine
    Guest

    Hi,

    I would wish to know if ther eis a W3TC function that can be called to flush the cache programatically. Let’s say that I have a website for a home holiday with an availabilty calendar. I wish tu run a function that flush the W3TC each time I receive a new reservation (so accurate availability is displayed to my visitors). I have a filter to run some code whenever a new reservation is received. So looking for the W3TC function that I can execute to flush the cache.

    Thank you!

    Best regards

    #35169
    Marko Vasiljevic
    Keymaster

    Hello Celine,

    Thank you for your inquiry and I am happy to assist you with this.
    You can use w3tc_flush_all
    You can check more functions in wp-content/plugins/w3-total-cache/w3-total-cache-api.php
    In this case the function:

    /**
     * Purges/Flushes everything
     */
    function w3tc_flush_all( $extras = null ) {
    	$o = \W3TC\Dispatcher::component( 'CacheFlush' );
    	$o->flush_all( $extras );

    Thanks!

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘How to Flush W3TC Programatically?’ is closed to new replies.