Support » Plugin: W3 Total Cache » Programmatically Clean Cache

  • Resolved josmatic

    (@josmatic)


    Hi, I use a lot W3 and I am intrested can I write PHP code to run clearing cache programmatically? Best regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @josmatic,

    Thank you for your inquiry and I am happy to assist you with this.
    The answer is yes, you can but there is already a way to clear all cache programmatically with w3tc_flush_all();
    /**
    * Purges/Flushes everything
    */
    function w3tc_flush_all( $extras = null ) {
    $o = \W3TC\Dispatcher::component( ‘CacheFlush’ );
    $o->flush_all( $extras );
    You can find more functions in w3-total-cache-api.php
    I hope this helps.

    josmatic

    (@josmatic)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Programmatically Clean Cache’ is closed to new replies.