W3cubDocs

/WordPress

WP_Query::rewind_posts()

Rewinds the posts and resets post index.

Source

public function rewind_posts() {
	$this->current_post = -1;
	if ( $this->post_count > 0 ) {
		$this->post = $this->posts[0];
	}
}

Changelog

Version Description
1.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_query/rewind_posts