WP_Optimize()->get_page_cache()->purge() not work in WP-CLI
-
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)
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.