From 08fc51b214bbdf43ea1db0060dd6286f1e5fa625 Mon Sep 17 00:00:00 2001 From: westi 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: http://svn.automattic.com/wordpress/trunk@14607 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 2cb8c6c0f..1e472d016 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;