WP_Query::have_comments
Determines whether there are more comments available.
Automatically rewinds comments when finished.
Method of the class: WP_Query{}
No Hooks.
Returns
true|false. True if comments are available, false if no more comments.
Usage
global $wp_query; $wp_query->have_comments();
Changelog
| Since 2.2.0 | Introduced. |
WP_Query::have_comments() WP Query::have comments code WP 7.0
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;
}