Clear cache programmatically
-
I’m looking for a way to clear cache programmatically from the frontend– in other words, a function or action I can call, without being logged in, to flush all w3tc caches. This would have the same effect as the “Empty all caches” button on the wp admin toolbar, but be accessible in my own theme files. for example,
function my_clear_all_caches() { if(isset($_GET['clear_cache'])) { flush_all_w3tc_cache(); // This is not a real function; I'm looking for what should be plugged in here } } add_action('init', 'my_clear_all_caches');
Many thanks for any help!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Clear cache programmatically’ is closed to new replies.