Skip to content

Plugin Updated: Cache Manager


22 September 2021

22:22:28 GMT+0000

We added a filter to check if the current user can purge the cache.

vip_cache_manager_can_purge_cache returns a boolean whether current user should be able to see Flush Cache button. Defaults to current_user_can( 'manage_options' ).

// Allow editors and up to be able to purge a page from cache
add_filter( 'vip_cache_manager_can_purge_cache', function( $can_purge, $user ) { 
    return current_user_can( 'edit_others_posts' );
}, 10, 2 );

https://github.com/Automattic/vip-go-mu-plugins/pull/2427