capability)) return; add_action( 'admin_head', array($this,'flush_w3tc_cache')); add_action( 'admin_head', array($this,'flush_fastest_cache')); add_action( 'admin_head', array($this,'flush_zen_cache')); //keep getting errors from wp-rocket. //add_action( 'admin_head', array($this,'flush_wp_rocket')); } public function flush_w3tc_cache() { if (function_exists('w3tc_flush_all')) { w3tc_flush_all(); } } public function flush_fastest_cache() { if(class_exists('WpFastestCache') ) { $GLOBALS["wp_fastest_cache"]->deleteCache(TRUE); } } public function flush_zen_cache() { if (class_exists('\\zencache\\plugin') ) { $GLOBALS['zencache']->clear_cache(); } } public function flush_wp_rocket() { if (function_exists("rocket_clean_domain")) { rocket_clean_domain(); } } }//class closure }