Visibility Hierarchy
Visibility Hierarchy
The Private Comments plugin implements a strict visibility hierarchy to ensure that discussions remain confidential. Comment access is determined by a user's relationship to the specific comment or the post it belongs to.
Access Control Levels
Visibility is categorized into three primary tiers:
1. Administrative Access (Full Visibility)
Users with the Administrator role have unrestricted access. They can view all comments across the entire website, regardless of who authored the comment or the post.
2. Post Author Access (Post-Level Visibility)
The Post Author (the user who created the post or page) can see all comments submitted to their specific content. This allows authors to moderate and engage with their audience privately.
3. Comment Author Access (Individual Visibility)
The Comment Author can see their own comments and any replies directly associated with their thread. However, they cannot see comments made by other users on the same post (unless those users are Administrators or the Post Author).
Visibility Matrix
The following table outlines what different users see when visiting a post:
| User Role | Can See Own Comments? | Can See Others' Comments? | | :--- | :---: | :---: | | Administrator | Yes | Yes (All) | | Post Author | Yes | Yes (On their posts only) | | Comment Author | Yes | No | | General Public / Other Logged-in Users | No* | No |
*Note: Anonymous users or logged-in users who have not participated in the thread will see a "No comments yet" state or the comment count will reflect only the comments they are permitted to see.
Example Scenarios
To better understand how the hierarchy functions in practice, consider a post written by User A:
- Scenario 1: User B leaves a comment. Only User B, User A (Post Author), and the Site Admin can see this comment.
- Scenario 2: User C logs in and views the same post. User C will see zero comments, as they are neither the author of the post nor the author of the existing comment.
- Scenario 3: User A (Post Author) replies to User B. Both User A and User B can see the entire conversation thread. User C still sees nothing.
Frontend vs. Backend Visibility
- Frontend: The restrictions are applied automatically to the comment loop. The comment count shown on the frontend will dynamically adjust to reflect only the comments visible to the current viewer.
- Backend (WP-Admin): This plugin primarily manages frontend visibility. Standard WordPress capabilities still apply within the WordPress Dashboard (Comments menu).