Quantcast
Channel: WordPress.org Forums » [W3 Total Cache] Support
Viewing all articles
Browse latest Browse all 19300

B on "[Plugin: W3 Total Cache] Clear cache programmatically"

$
0
0

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!

https://wordpress.org/plugins/w3-total-cache/


Viewing all articles
Browse latest Browse all 19300

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>