-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add filter to allow customizing who can flush the cache #535
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
@@ -2,6 +2,7 @@ | |||
|
|||
## Unreleased | |||
|
|||
- Added `roc_manage_redis_capability` filter and `WP_REDIS_MANAGER_CAPABILITY` constant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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