Add filter to allow customizing who can flush the cache#535
Add filter to allow customizing who can flush the cache#535tillkruss merged 3 commits intorhubarbgroup:developfrom
Conversation
|
This was the code i used to test that this worked for the author role: add_filter( 'roc_manage_redis_capability', function( $cap ) {
return 'publish_posts';
}); |
|
Resolved conflict in changelog |
|
Should we also make this a constant for easier access? |
|
You would only be able to define your default as a constant though right? Since the constant can't change after being filtered? |
Yeah, it would be set once in the |
|
Oh I see what you mean, inverse of what I was thinking. It's monday... I could see that being handy too yeah. I can update my PR and fix those codestyle complaints. Any preference on your constant name? |
|
Nevermind those errors are yours :P enjoy! |
|
Opted for |
CHANGELOG.md
Outdated
|
|
||
| ## Unreleased | ||
|
|
||
| - Added `roc_manage_redis_capability` filter and `WP_REDIS_MANAGER_CAPABILITY` constant |
There was a problem hiding this comment.
@pmgarman: Could you add these to the README as well?
|
@tillkruss try this on for size |
* Add filter and constant to allow customizing who can manage the plugin * Update CHANGELOG.md * Update README.md --------- Co-authored-by: Till Krüss <[email protected]>
Couldn't find a CONTRIBUTING.md (i may be blind) so took a best guess. Also just assumed 2.6 but who knows?!
I think this could easily be a thing that gets enhanced deeper for multisite to allow individual site owners to flush their individual sites cache or something along those lines... but this probably serves my needs well enough :D