From 728b90a13b05a06bfdba72f85a520d89ec857df9 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Thu, 13 May 2010 20:39:54 +0000 Subject: [PATCH] Introduce wp_reset_postdata(). Use it to reset the post global for the current query_posts() call after using a loop with a new WP_Query object. Fixes #12320 props scribu. git-svn-id: https://develop.svn.wordpress.org/trunk@14607 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/default-widgets.php | 4 +++- wp-includes/query.php | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index 2cb8c6c0f6..1e472d0167 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -554,7 +554,9 @@ class WP_Widget_Recent_Posts extends WP_Widget { post) ) { $GLOBALS['post'] = $wp_query->post;