[wp-trac] [WordPress Trac] #24826: Add __construct function to the "WP_Comment_Query" Class

WordPress Trac noreply at wordpress.org
Mon Mar 16 14:23:36 UTC 2015


#24826: Add __construct function to the "WP_Comment_Query" Class
---------------------------------------+---------------------------
 Reporter:  ramiy                      |       Owner:  boonebgorges
     Type:  enhancement                |      Status:  closed
 Priority:  normal                     |   Milestone:  4.2
Component:  Comments                   |     Version:  3.5
 Severity:  normal                     |  Resolution:  fixed
 Keywords:  has-patch commit 4.2-beta  |     Focuses:
---------------------------------------+---------------------------
Changes (by boonebgorges):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"31793"]:
 {{{
 #!CommitTicketReference repository="" revision="31793"
 Improve method consistency in `WP_Comment_Query`.

 * Introduce a `__construct()` method, which can accept an array of query
 vars.
 * Move query logic out of `query()` method and into a new `get_comments()`
 method.
 * Ensure that `$this->comments` is set whenever `get_comments()` returns a
 value.
 * Introduce a `parse_query()` method, where query vars are parsed with
 default values and the 'parse_comment_query' action is fired.

 These changes bring `WP_Comment_Query` syntax closer to that of
 `WP_Query`.

 Props westonruter, morganestes, boonebgorges.
 Fixes #24826.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/24826#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list