Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#50528 closed defect (bug) (reported-upstream)

The documentation of WP_Comment_Query is incorrect

Reported by: dinhtungdu's profile dinhtungdu Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Comments Keywords:
Focuses: docs Cc:



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)

#1 @audrasjb
4 years ago

Hi @dinhtungdu and thank you for spotting this,

I updated "Basic usage" section on DevHub accordingly:

#2 @audrasjb
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

Closing this ticket as reported-upstream since it doesn't require changes on WordPress core.
Thanks again, @dinhtungdu!

Last edited 4 years ago by audrasjb (previous) (diff)
Note: See TracTickets for help on using tickets.