Destroys the previous query and sets up a new query.
Description
This should be used after query_posts() and before another query_posts().This will remove obscure bugs that occur when the previous WP_Query object is not destroyed properly before another is set up.
Uses · 1
wp_reset_postdata()After looping through a separate query, this function restores the $post global to the current post in the main query.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/query.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.