[wp-trac] [WordPress Trac] #50528: The documentation of WP_Comment_Query is incorrect

WordPress Trac noreply at wordpress.org
Thu Jul 2 05:33:43 UTC 2020


#50528: The documentation of WP_Comment_Query is incorrect
--------------------------+-----------------------------
 Reporter:  dinhtungdu    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:
 Severity:  normal        |   Keywords:
  Focuses:  docs          |
--------------------------+-----------------------------
 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
 [https://developer.wordpress.org/reference/classes/wp_comment_query
 /#basic-usage basic usage] as well.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50528>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list