API / Minn\Runtime / CommentThreads

CommentThreads final class

Minn\Runtime\CommentThreads · public/minn/src/Minn/Runtime/CommentThreads.php · 68 lines

A threaded or flat comment query's descendants as the reference fills them (probe wp-comment-query-sql): one more comment query a level, with the query's own variables but the level's parents, no parent, no limit and no count; a threaded query hangs each reply under its parent, marks every comment's children as known and keeps the top level by id, a flat one lists the top level and then each level in its query's order.

Constants and properties

privateLEVEL = array ( 'parent' => '', 'hierarchical' => false, 'number' => 0, 'offset' => 0, 'no_found_rows' => true, )

Public

methodfill(WP_Comment_Query $query, array $top): array#

The query's top-level comments with their descendants filled in.

$toplist<\WP_Comment>
@return array<int, \WP_Comment>
staticflatten(array $children, array $args): array#

A comment's children, then each one's own, depth first, as a list.

$childrenarray<array-key, mixed>
$argsarray<string, mixed>get_children()'s arguments, handed down
@return list<\WP_Comment>