WordPress at a glance
function is not described

WP_Query::next_post() WP 1.5.0

Set up the next post and iterate current post index.

This is a method of the class: WP_Query

No Hooks.

Return

WP_Post. Next post.

Usage

$WP_Query = new WP_Query();
$var = $WP_Query->next_post();

Code of WP Query::next post: wp-includes/class-wp-query.php WP 5.2

<?php
public function next_post() {

	$this->current_post++;

	$this->post = $this->posts[ $this->current_post ];
	return $this->post;
}