Hello Jacob,
you could use hook clean_post_cache for it if wp_optimize supported it. I reporter it here and there is a work around:
https://ww.wp.xz.cn/support/topic/clean_post_cache-hook/
Thanx but i rather want to know what Clear cache for all pages from the menu bar does, e.g. what https://betatest.opajaap.nl/?_wpo_purge=05e4529a24 does
You can trigger a cache purge using WP-Optimize public functions.
Use WP_Optimize()->get_page_cache()->purge(); to flush the whole cache.
Use WPO_Page_Cache::delete_single_post_cache($post_id); to purge a single post’s files.
Those cache options are available from WordPress action plugins_loaded.
(See WordPress actions order: https://codex.ww.wp.xz.cn/Plugin_API/Action_Reference)
Thanx. This works:
// WP Optimize cache
if ( class_exists( 'WP_Optimize' ) ) {
WP_Optimize()->get_page_cache()->purge();
}
No problem, glad it helped!