WP Discourse comment webhook does not trigger a WP Rocket Cache refresh

I forgot to mention, your update did fix the issue! Thank you. :+1:t3:

For anyone else running into this issue while running WP-Rocket with WP-Discourse. The following code (insert in your Wordpress function file) will ensure once a comment is made on the corresponding Discourse post, it will purge the cache for that post.

if( function_exists( 'rocket_clean_post' ) ){
	add_action( 'wpdc_after_webhook_post_update', 'bulk_rocket_clean_post’);
}

function bulk_rocket_clean_post(array $ids){
    foreach ($ids as $id) {
        rocket_clean_post($id);
    }
}
3 Likes