• Resolved marketwo

    (@marketwo)


    hello,
    I have tried to insert your function WP_Optimize()->get_page_cache()->purge(); into one of my WP-CLIs to trigger the purge cache at certain times I have defined during the day.
    But the purge cache does not work, there are no php errors but the cache is not cleared.

    The function executed within the WP-CLI is:
    add_action( ‘plugins_loaded’, ‘custom_wp_optimize_purge_cache’ );

    function custom_wp_optimize_purge_cache() {
    WP_Optimize()->get_page_cache()->purge();
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter marketwo

    (@marketwo)

    Is it possible that the plugisn_loaded action is not triggered in wp-cli? If so, how can I trigger the purge cache in wp-cli and make sure that wp-optimize has been loaded?

    @marketwo Implementing purging of cache with WP-CLI is not a feature yet, I’ll discuss this with our development team in our next company meeting and see if this feature can be implemented in future release.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP_Optimize()->get_page_cache()->purge() not work in WP-CLI’ is closed to new replies.