WP_Query::rewind_comments() WordPress Method

WP_Query::rewind_comments() is a method used in the WordPress class WP_Query. It is used to reset the comment index for the current query. This is useful for looping through comments multiple times.

WP_Query::rewind_comments() #

Rewind the comments, resets the comment index and comment to first.


Source

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

	public function rewind_comments() {
		$this->current_comment = -1;
		if ( $this->comment_count > 0 ) {
			$this->comment = $this->comments[0];
		}
	}


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.