WP_Comment::get_child() WordPress Method

The WP_Comment::get_child() function can be used to get the children of a comment. This function is useful for threaded comments.

WP_Comment::get_child( int $child_id ) #

Get a child comment by ID.


Parameters

$child_id

(int)(Required)ID of the child.


Top ↑

Return

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


Top ↑

Source

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

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

		return false;
	}

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.