#50528 closed defect (bug) (reported-upstream)
The documentation of WP_Comment_Query is incorrect
Reported by: | dinhtungdu | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Comments | Keywords: | |
Focuses: | docs | Cc: |
Description
See: https://developer.wordpress.org/reference/classes/wp_comment_query/#more-information
When you create an instance of this class passing an array of arguments to it’s constructor, the class will automatically run the query method and return an array of comments.
This is incorrect, when we create an instance of WP_Comment_Query with non-empty argument, the class always returns an instance of WP_Comment_Query, not an array of comments. This leads to incorrect example of basic usage as well.
Change History (2)
Note: See
TracTickets for help on using
tickets.
Hi @dinhtungdu and thank you for spotting this,
I updated "Basic usage" section on DevHub accordingly: https://developer.wordpress.org/reference/classes/wp_comment_query/