WP_Comment::populated_children() WordPress Method

The WP_Comment::populated_children() method is used to check if a comment has any children. This is useful for checking if a comment is a reply to another comment.

WP_Comment::populated_children( bool $set ) #

Set the ‘populated_children’ flag.


Description

This flag is important for ensuring that calling get_children() on a childless comment will not trigger unneeded database queries.


Top ↑

Parameters

$set

(bool)(Required)Whether the comment's children have already been populated.


Top ↑

Source

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

	public function populated_children( $set ) {
		$this->populated_children = (bool) $set;
	}

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.