Purge Cache on ACF Save Post
-
I would like to have the cache auto purge for all pages if I click save on any page/post. These pages/posts have ACF fields attached to them so I need to have the cache to bust on save. I have used the following code with Siteground cache and works with them but how can I modify it to work with WP-Optimize?
<?php add_action( 'acf/save_post', function( $post_id ) { error_log( 'ACF action triggered' ); if ( function_exists( 'sg_cachepress_purge_cache' ) ) { error_log( 'Function exists, clearing cache' ); sg_cachepress_purge_cache(); } else { error_log( 'Didnt find the function' ); } });
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Purge Cache on ACF Save Post’ is closed to new replies.