WP_Comment::add_child │ public │ WP 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.

Returns

null. Nothing (null).

Usage

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

Changelog

Since 4.4.0 Introduced.

WP_Comment::add_child() code WP 7.1.2

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