WP_Comment::add_child()publicWP 4.4.0

Adds a child to the comment.

Used by WP_Comment_Query when bulk-filling descendants.

Method of the class: WP_Comment{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_Comment = new WP_Comment();
$WP_Comment->add_child( $child );
$child(WP_Comment) (required)
Child comment.

Changelog

Since 4.4.0 Introduced.

WP_Comment::add_child() code WP 6.5.4

public function add_child( WP_Comment $child ) {
	$this->children[ $child->comment_ID ] = $child;
}