wp_reset_postdata

Advertisement

Summery Summery

After looping through a separate query, this function restores the $post global to the current post in the main query.

Syntax Syntax

wp_reset_postdata()

Source Source

File: wp-includes/query.php

function wp_reset_postdata() {
	global $wp_query;

	if ( isset( $wp_query ) ) {
		$wp_query->reset_postdata();
	}
}

Advertisement

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

What are you looking for?