WordPress at a glance
function is not described

WP_Query::next_post() public WP 1.5.0

Set up the next post and iterate current post index.

{} It's a method of the class: WP_Query{}

No Hooks.

Return

WP_Post. Next post.

Usage

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

Changelog

Since 1.5.0 Introduced.

Code of WP_Query::next_post() WP 5.6

<?php
public function next_post() {

	$this->current_post++;

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