Latest Comments: Add option to exclude post author #72850
+49
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Closes #72845
Adds an "Exclude post author" option to the Latest Comments block, allowing users to filter out comments made by the post author from the displayed list.
Why?
Currently, the Latest Comments block displays all comments including replies from the blog author. For blogs where authors actively reply to comments, this can clutter the "Latest Comments" list with the author's own responses instead of highlighting community engagement and reader feedback. This feature gives users control over whether to show or hide the post author's comments in the Latest Comments block.
How?
excludePostAuthorboolean attribute toblock.json(default:false)edit.jssettings panel to control the filtering optionindex.phpusingarray_filter()to exclude comments wherecomment.user_idmatchespost.post_authorexcludePostAuthoris set totrueuser_id = 0) are always preserved regardless of the settingTesting Instructions
Basic Functionality:
Edge Cases:
Testing Instructions for Keyboard
Tabto navigate through the block toolbar to the settings panelTabuntil you reach the "Exclude post author" toggleSpaceorEnterto toggle the checkbox on/offScreenshots or screencast
Settings Panel View:
Additional Notes
falseto maintain existing behavior (show all comments)