Hi there,
> How to do this with your plugin?
Unfortunately, this isn’t currently possible.
Marc.
It could be an important feature to add. I’m bypassing this issue by re-saving the widget everytime I add a new post. It’s the only way I’ve found to have the latest posts updated on the sidebar. Despite this issue WP-Optimize is an awsome cache plugin too.
@tunisi45
Saving the widgets simply purges all the cache, so you could do just that.
If you want to do it automatically, you can use the wpo_purge_all_cache_on_update filter:
add_filter( 'wpo_purge_all_cache_on_update', '__return_true' );
or for something more specific:
add_filter( 'wpo_purge_all_cache_on_update', function($purge, $post_id) {
// Check something about that post (e.g. post_type, category...)
if (checksomething($post_id)) {
return true;
}
return $purge;
}, 20, 2 );