diff --git wp-includes/query.php wp-includes/query.php
index dc56be4..1b6438d 100644
--- wp-includes/query.php
+++ wp-includes/query.php
@@ -2820,7 +2820,7 @@ class WP_Query {
 			do_action_ref_array('loop_start', array(&$this));
 
 		$post = $this->next_post();
-		setup_postdata($post);
+		$this->setup_postdata($post);
 	}
 
 	/**
@@ -3013,6 +3013,50 @@ class WP_Query {
 	}
 
 	/**
+	 * Set up global post data.
+	 *
+	 * @param object $post Post data.
+	 * @uses do_action_ref_array() Calls 'the_post'
+	 * @return bool True when finished.
+	 */
+	function setup_postdata($post) {
+		global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;
+
+		$id = (int) $post->ID;
+
+		$authordata = get_userdata($post->post_author);
+
+		$currentday = mysql2date('d.m.y', $post->post_date, false);
+		$currentmonth = mysql2date('m', $post->post_date, false);
+		$numpages = 1;
+		$page = $this->get('page');
+		if ( !$page )
+			$page = 1;
+
+		if ( $this->is_single() || $this->is_page() || $this->is_feed() )
+			$more = 1;
+		$content = $post->post_content;
+		if ( strpos( $content, '<!--nextpage-->' ) ) {
+			if ( $page > 1 )
+				$more = 1;
+			$multipage = 1;
+			$content = str_replace("\n<!--nextpage-->\n", '<!--nextpage-->', $content);
+			$content = str_replace("\n<!--nextpage-->", '<!--nextpage-->', $content);
+			$content = str_replace("<!--nextpage-->\n", '<!--nextpage-->', $content);
+			$pages = explode('<!--nextpage-->', $content);
+			$numpages = count($pages);
+		} else {
+			$pages = array( $post->post_content );
+			$multipage = 0;
+		}
+
+		do_action_ref_array('the_post', array(&$post));
+
+		return true;
+	}
+
+
+	/**
 	 * Constructor.
 	 *
 	 * Sets up the WordPress query, if parameter is not empty.
@@ -3587,36 +3631,11 @@ function wp_old_slug_redirect() {
  * @return bool True when finished.
  */
 function setup_postdata($post) {
-	global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;
-
-	$id = (int) $post->ID;
-
-	$authordata = get_userdata($post->post_author);
+	global $wp_query;
 
-	$currentday = mysql2date('d.m.y', $post->post_date, false);
-	$currentmonth = mysql2date('m', $post->post_date, false);
-	$numpages = 1;
-	$page = get_query_var('page');
-	if ( !$page )
-		$page = 1;
-	if ( is_single() || is_page() || is_feed() )
-		$more = 1;
-	$content = $post->post_content;
-	if ( strpos( $content, '<!--nextpage-->' ) ) {
-		if ( $page > 1 )
-			$more = 1;
-		$multipage = 1;
-		$content = str_replace("\n<!--nextpage-->\n", '<!--nextpage-->', $content);
-		$content = str_replace("\n<!--nextpage-->", '<!--nextpage-->', $content);
-		$content = str_replace("<!--nextpage-->\n", '<!--nextpage-->', $content);
-		$pages = explode('<!--nextpage-->', $content);
-		$numpages = count($pages);
-	} else {
-		$pages = array( $post->post_content );
-		$multipage = 0;
+	if ( is_a( $wp_query, 'WP_Query' ) ) {
+		return $wp_query->setup_postdata( $post );
 	}
 
-	do_action_ref_array('the_post', array(&$post));
-
-	return true;
+	return false;
 }
