Share your thoughts on improving our Content Control Plugin. Your feedback is valuable to us. Let’s team up to make it better! Thank you in advance for your help and awesomeness. 🤩
Exempt post authors from being restricted from their own posts & archive (author page)
Can't imagine there are a ton of uses for this, but we have a custom post type that is restricted to anyone on the same user level as the author of it. Only those above can read it.
However, we want the author to be able to view their content in a live setting, and also view their archive.
I have been trying to do this in the plugin itself, but now think a better move would be a script placed in functions.php that basically overrides the plugin and works like this…
If username = custom post author then disable Content Control
and
If username = author archive name then disable Content Control
Still working on it, thank you.
2 thoughts on “Exempt post authors from being restricted from their own posts & archive (author page)”
Leave a Reply Cancel reply
Top Requests
- Restrict Content By Location 3 Votes
- Restriction Analytics 1 Vote
- User Registration Approval 1 Vote
- Different Protection Methods for Different Devices 1 Vote
- Restriction Expiration Cookie 1 Vote
You can do it manually with a few filters etc, or you could write a custom php function that simply returns true/false, and then use our Pro version to turn that into a new conditional rule for restricting content.
That said I also think some new rules for content matching based on author & author meta are a viable solution as well, so maybe upvote this one: https://contentcontrolplugin.com/feature-requests/make-pages-and-posts-published-by-a-user-with-a-role-only-visible-to-some-roles-and-not-visible-to-other-roles/
Oh it should also be noted:
1. You can add more than one rule set, first one (top to bottom) that matches gets applied and rest ignored. So try adding a second rule set that allows explicitly the author to view their own content, and setting it to the top of the list.
2. You can use a filter to bypass this match-first policy and force it to check all rules, for those cases where they might match 2 rules, one restricting, one allowing. When you use the filter it will check all rule sets and any match allows access.