Skip to content

feat: CommentQuery (WP_Comment_Query) - #10

Merged
ogorzalka merged 1 commit into
mainfrom
feat/comment-query
Oct 15, 2026
Merged

ogorzalka merged 1 commit into
mainfrom
feat/comment-query

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Stacked on #9.

New CommentQuery builder for WP_Comment_Query. metaQuery(), dateQuery(), MetaField, LimitsResults and PagedResults are reused as is; orderBy() as a field => direction map is extracted to the OrdersByMap concern shared with UserQuery.

All documented parameters are covered, except top-level order (the orderby map carries one direction per field).

  • Terminals: get(), first(), ids(), count(), exists() (run on a copy)
  • WP's default status => all (hold + approve, no spam/trash) and no_found_rows => true are kept and documented, unlike the 'no constraint' defaults of PostQuery/TermQuery, since listing spam by default would be unsafe

Pest: 201 passed.

- CommentQuery reusing metaQuery(), dateQuery(), MetaField, limits and paging concerns
- OrdersByMap concern shared by UserQuery and CommentQuery
- terminals: first, ids, count, exists
@ogorzalka
ogorzalka changed the base branch from refactor/shared-concerns to main October 15, 2026 14:07
@ogorzalka
ogorzalka merged commit baa8a60 into main Oct 15, 2026
2 checks passed
@ogorzalka
ogorzalka deleted the feat/comment-query branch October 15, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant