wp-includes/query.php:127After looping through a separate query, this function restores the $post global to the current post in the main query.
function wp_reset_postdata() { global $wp_query; if ( isset( $wp_query ) ) { $wp_query->reset_postdata(); }}Introduced in 3.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/query.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.