How to make a post visible to only:
-
The post author, irrespective of its user role.
-
All users from a specific user role.
Other then these, no one should be able to see the post.
How should I approach this.
Note that I have only three user roles in WP. Admin, and 2 other custom roles.
Give your custom roles the capability to “read_member_posts” or whatever. Then you could apply a filter to the_content()
We already got a plugin in the WPSE Plugin Repository written by BAinternet, that does exactly that.