WP_Query::next_post() – Set up the next post and iterate current post index.

You appear to be a bot. Output may be restricted

Description

Set up the next post and iterate current post index.

Usage

$WP_Post = WP_Query::next_post();

Parameters

Returns

WP_Post Next post.

Source

File name: wordpress/wp-includes/class-wp-query.php
Lines:

1 to 8 of 8
  public function next_post() {

    $this->current_post++;

    
/** @var WP_Post */
    $this->post = $this->posts[ $this->current_post ];
    return $this->post;
  }
 

 View on GitHub View on Trac