WP_Query::next_comment() WordPress Method

The next_comment() method advances the internal comment pointer in the $wp_query object and returns the next comment in the comment list.

WP_Query::next_comment() #

Iterate current comment index and return WP_Comment object.


Return

(WP_Comment) Comment object.


Top ↑

Source

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

	public function next_comment() {
		$this->current_comment++;

		/** @var WP_Comment */
		$this->comment = $this->comments[ $this->current_comment ];
		return $this->comment;
	}


Top ↑

Changelog

Changelog
VersionDescription
2.2.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.

Show More