Without comments, a website is as effective at creating a community as the Chicago Cubs are at winning World Series titles. WordPress 4.4 is a rebuilding release and the comments system is much improved under the hood.
This release lays the groundwork for future features and improvements.
A New Classy and Strong Comment Object
WP_Comment class provides a single organized comment object that models its row in
$wpdb->comments. You may be familiar with this approach from
WP_Post, which inspired the caching implementation used in
This was a prerequisite to many of the other comment-related bug fixes and features added in 4.4. The
WP_Comment class is marked final to retain flexibility while it is young.
Comment Queries for the Whole Family
WP_Comment_Query has new query parameters for traversing your comments family tree.
parent__intakes an array of comment parent IDs to return all matching children.
parent__not_intakes an array of comment parent IDs and does not return any matching children.
hierarchicalcan be set to either
threadedreturns a tree for matched comments, with the children for each comment included in its
flatreturns a flat array of matched comments plus their children.
falsedoes not include descendants for matched comments. This is the default behavior.
orderbyhas a new option
comment__in, useful when querying by
comment__inthe matched results will return in the same order.