WP_Comment::get_child()publicWP 4.4.0

Gets a child comment by ID.

Method of the class: WP_Comment{}

No Hooks.

Return

WP_Comment|false. Returns the comment object if found, otherwise false.

Usage

$WP_Comment = new WP_Comment();
$WP_Comment->get_child( $child_id );
$child_id(int) (required)
ID of the child.

Changelog

Since 4.4.0 Introduced.

WP_Comment::get_child() code WP 6.5.2

public function get_child( $child_id ) {
	if ( isset( $this->children[ $child_id ] ) ) {
		return $this->children[ $child_id ];
	}

	return false;
}