-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Comments: Add filter for comment types excluded from queries by default #12310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adamsilverstein
wants to merge
31
commits into
WordPress:trunk
Choose a base branch
from
adamsilverstein:feature/65537-excluded-comment-types-filter
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
b7cb7fc
Comments: Add filter for comment types excluded from queries by default
adamsilverstein 4b57b1a
Apply suggestion from @adamsilverstein
adamsilverstein 9e9fb0b
Apply suggestion from @adamsilverstein
adamsilverstein 6e67226
Apply suggestion from @adamsilverstein
adamsilverstein 237d916
Apply suggestion from @adamsilverstein
adamsilverstein bb238e9
Comments: Clarify the default_excluded_comment_types filter is not ac…
adamsilverstein 1a4bf12
Comments: Feed default_excluded_comment_types into the comment counter.
adamsilverstein 2f75e55
Comments: Honor default_excluded_comment_types in pending counts.
adamsilverstein e656cbd
Comments: Extract wp_get_default_excluded_comment_types().
adamsilverstein 9355bd4
Merge branch 'trunk' into feature/65537-excluded-comment-types-filter
adamsilverstein e0d3cf9
Comments: Treat aliased type requests as explicit against excluded ty…
adamsilverstein 4f69762
Comments: Keep a comment type named '0' in the excluded types list.
adamsilverstein 0ded145
Comments: Drop the unsupported "feeds" claim from the filter docblock.
adamsilverstein c082ed3
Comments: Apply the excluded types filter in the comments list table.
adamsilverstein bebcf94
Merge branch 'trunk' into feature/65537-excluded-comment-types-filter
adamsilverstein 91e2876
Merge branch 'trunk' into feature/65537-excluded-comment-types-filter
adamsilverstein b3fc3ef
Comments: Drop non-scalar values from the excluded comment types filter.
adamsilverstein e658376
Potential fix for pull request finding
adamsilverstein 3e371d0
Merge branch 'trunk' into feature/65537-excluded-comment-types-filter
adamsilverstein 3d507a5
Merge branch 'trunk' into feature/65537-excluded-comment-types-filter
adamsilverstein 29af50b
Merge branch 'trunk' into feature/65537-excluded-comment-types-filter
adamsilverstein e0e1c5e
Comments: Let the list table show an explicitly requested excluded type.
adamsilverstein 106def5
Merge branch 'trunk' into feature/65537-excluded-comment-types-filter
adamsilverstein 0a788e4
Merge remote-tracking branch 'origin/trunk' into feature/65537-exclud…
adamsilverstein 50e826e
Comments: Include the excluded comment types in the comment query cac…
adamsilverstein ef244ab
Comments: Exclude the default-excluded comment types from the comment…
adamsilverstein f1bc386
Comments: Default the excluded comment types to the registered intern…
adamsilverstein 5aec019
Comments: Pin the visibility boundaries of the excluded comment types.
adamsilverstein 05d3739
Comments: Filter empty excluded comment types with a boolean callback.
adamsilverstein eee634d
Comments: Apply the default comment type exclusions to comment page m…
adamsilverstein 00576f0
Comments: Stamp the excluded-types filter work for 7.2.0.
adamsilverstein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, fixed in e0e1c5e.
I didn't drop
type__not_inentirely though - the list table still has to force the exclusions for atype=allrequest.WP_Comment_Queryskips its default exclusions when 'all' is requested, and there is an existing test (test_comments_list_table_does_not_show_note_comment_type, added for #64198/#64474) asserting notes stay hidden onedit-comments.php?comment_type=all. Removing the arg outright regresses that.Instead the requested type is now subtracted from the exclusion list before the query runs, with the 'comment'/'comments'/'pings' aliases expanded the same way
WP_Comment_Queryexpands them:The 'note' type is still stripped from the request a few lines above, so that one remains unlistable in the admin regardless.
Added two tests in
tests/phpunit/tests/admin/wpCommentsListTable.php: a filtered-in 'private' type stays hidden for both an empty and anallrequest, and it is listed when explicitly selected. The second one fails against the old code (0 items) and passes now.