WP_Query::have_comments(): bool

In this article

Determines whether there are more comments available.

Description

Automatically rewinds comments when finished.

Return

bool True if comments are available, false if no more comments.

Source

public function have_comments() {
	if ( $this->current_comment + 1 < $this->comment_count ) {
		return true;
	} elseif ( $this->current_comment + 1 == $this->comment_count ) {
		$this->rewind_comments();
	}

	return false;
}

Changelog

VersionDescription
2.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.