#24826 closed enhancement (fixed)
Add __construct function to the "WP_Comment_Query" Class
| Reported by: | ramiy | Owned by: | boonebgorges |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.2 |
| Component: | Comments | Version: | 3.5 |
| Severity: | normal | Keywords: | has-patch commit 4.2-beta |
| Cc: | Focuses: |
Description
Add PHP5 construct function to the comments query class, just like we have constructor functions on WP_Query and WP_User_Query classes.
Attachments (5)
Change History (24)
#2
@
13 years ago
- Cc added
- Keywords has-patch added; needs-patch removed
- Severity major → normal
- Version 3.1 → trunk
#4
@
12 years ago
- Keywords needs-refresh added; 2nd-opinion dev-feedback removed
- Milestone Awaiting Review → Future Release
This does improve the class, but the patch currently explodes
#5
@
12 years ago
- Keywords needs-refresh removed
In 24826.diff merged core patch and unit test patch into one, and fixed conflicts.
This ticket was mentioned in Slack in #core by drew. View the logs.
11 years ago
#10
@
11 years ago
- Keywords commit added
- Owner set to
- Status new → reviewing
@morganestes: Thanks for the refresh. We should probably update the @since versions on WP_Comment_Query::get_comments() and the new constructor to 4.2.0. Barring that, I think we can move this for commit consideration.
@boonebgorges: Any chance you could review this?
#11
@
11 years ago
Yes, I can review. I would only feel comfortable moving forward if I had some time to review the documentation and some backward compatibility issues. If this needs to be committed today to make 4.2.0, let's punt. If it can go in sometime in the next week, let's keep it in 4.2.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Add
WP_Comment_Query::__construct()for parity withWP_Query::__construct()Also:
Add
WP_Comment_Query::get_comments()for parity withWP_Query::get_posts()Add
WP_Comment_Query::$commentsfor parity withWP_Query::$postsDeclare
WP_Comment_Query::$query_varswhich was previously implicitRelates to #15032
Patches are also on GitHub at:
https://github.com/x-team/WordPress/tree/24826
https://github.com/x-team/WordPress/commit/db6105cbaf60ca20501fafea29b0f8277ed03cd3
Passes unit tests for comment group; also added a new test for the changes to WP_Comment_Query (attached).