#63999 closed task (blessed) (fixed)
Ensure block comments are only displayed when requested and not in the comments thread
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Notes | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Related to the collaborative editing block comments feature, GB-66377.
Block comments are intended to be private. For editorial comments about rephrasing their public listing is sub-optimal, for comments about legal issues their public listing would be bad.
WP_Comment_Query will need to account for the new private comments paradigm to exclude these comments from being displayed in unwanted circumstances.
WP_Comment_Query( ['type' => ''] ) and WP_Comment_Query( ['type' => 'all'] ) currently return all comment types, this will need to be modified to exclude private comment types such as block comments.
There are a few potential approaches:
- Introduce comments types with a
publicly_queryableparameter similar to post types and statuses - Default
type__not_into includeblock_commentsby default and require it explicitly be removed
To avoid undue concern for people with editing permissions viewing the posts on the front end, the block comments should be hidden in the comment thread for both logged in and logged out users.
Change History (7)
This ticket was mentioned in PR #9948 on WordPress/wordpress-develop by @yashjawale.
2 months ago
#1
- Keywords has-patch added
#2
@
7 weeks ago
Reproduction Report
Description
This report validates whether block comments appear in public comment queries when they should be private by default.
Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.29
- Server: nginx/1.29.1
- Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
- Browser: Chrome 140.0.0.0
- OS: Linux
- Theme: Twenty Twenty-Five 1.3
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.0
Steps to Reproduce
- Create a post and add at least one normal comment and one block comment.
- Run get_comments() with these args:
['post_id' => $post_id, 'status' => 'approve'] ['post_id' => $post_id, 'type' => '', 'status' => 'approve'] ['post_id' => $post_id, 'type' => 'all', 'status' => 'approve']
- Observe that
block_commenttypes are returned in each case.
Actual Results
- ✅ Error condition occurs (reproduced).
Additional Notes
block_commentcreated by the Gutenberg collaborative editing feature. I added through REST API since I can't find the interface 😅, but the experimental feature should be clearly speficyblock_commenton the codes..- They are intended for internal/editorial use only and should never appear in public queries by default.
- Currently, they are returned in the most common query cases (type unset, empty, or all).
- This behavior risks exposing private editorial notes on the front end.
This ticket was mentioned in Slack in #core-editor by wildworks. View the logs.
5 weeks ago
#4
@
10 days ago
- Resolution set to fixed
- Status changed from new to closed
Based on my understanding, this ticket should have been resolved by [61105], so I will close it. cc @adamsilverstein @Mamaduka
@wildworks commented on PR #9948:
10 days ago
#5
As I understand it, this ticket should already be resolved, so I will close it. See https://core.trac.wordpress.org/ticket/63999#comment:4
The PR enables automatic exclusion of private comment types (specifically
block_comment) from all queries by default.Private comment types are only included when explicitly requested
typeortype__inparametersAdds a
get_private_comment_typesfilter hook to allow registration of additional private comment types when needed in the future...Works for
type=""&type="all"query scenariosTrac ticket: https://core.trac.wordpress.org/ticket/63999