WP_Comment::add_child() WordPress Method

The WP_Comment::add_child() function can be used to add a child comment to a parent comment. This function accepts two parameters: the child comment object and the parent comment object.

WP_Comment::add_child( WP_Comment $child ) #

Add a child to the comment.


Description

Used by WP_Comment_Query when bulk-filling descendants.


Top ↑

Parameters

$child

(WP_Comment)(Required)Child comment.


Top ↑

Source

File: wp-includes/class-wp-comment.php

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

Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.