Uses
Uses | Description |
---|---|
wp-includes/class-wp-query.php: WP_Query::setup_postdata() | Set up global post data. |
After looping through a nested query, this function restores the $post global to the current post in this query.
File: wp-includes/class-wp-query.php
public function reset_postdata() { if ( ! empty( $this->post ) ) { $GLOBALS['post'] = $this->post; $this->setup_postdata( $this->post ); } }
Version | Description |
---|---|
3.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_query/reset_postdata