WP_Query::next_comment()publicWP 2.2.0

Iterates current comment index and returns WP_Comment object.

Метод класса: WP_Query{}

Хуков нет.

Возвращает

WP_Comment. Comment object.

Использование

global $wp_query;
$wp_query->next_comment();

Список изменений

С версии 2.2.0 Введена.

Код WP_Query::next_comment() WP 6.8.1

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

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