WP_Query::have_comments
Determines whether there are more comments available.
Automatically rewinds comments when finished.
Метод класса: WP_Query{}
Хуков нет.
Возвращает
true|false. True if comments are available, false if no more comments.
Использование
global $wp_query; $wp_query->have_comments();
Список изменений
| С версии 2.2.0 | Введена. |
Код WP_Query::have_comments() WP Query::have comments WP 7.0.2
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;
}