Index: src/wp-includes/query.php
===================================================================
--- src/wp-includes/query.php	(revision 34086)
+++ src/wp-includes/query.php	(working copy)
@@ -4627,12 +4627,16 @@
 	 * @global int             $more
 	 * @global int             $numpages
 	 *
-	 * @param WP_Post $post Post data.
+	 * @param WP_Post|stdClass|int $post WP_Post instace or Post ID/object, which will be converted into WP_Post.
 	 * @return true True when finished.
 	 */
 	public function setup_postdata( $post ) {
 		global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;
 
+		if ( ! ( $post instanceof WP_Post ) ) {
+			$post = get_post( $post );
+		}
+
 		$id = (int) $post->ID;
 
 		$authordata = get_userdata($post->post_author);
@@ -4701,7 +4705,7 @@
 	public function reset_postdata() {
 		if ( ! empty( $this->post ) ) {
 			$GLOBALS['post'] = $this->post;
-			setup_postdata( $this->post );
+			$this->setup_postdata( $this->post );
 		}
 	}
 }
@@ -4772,7 +4776,7 @@
  *
  * @global WP_Query $wp_query
  *
- * @param object $post Post data.
+ * @param WP_Post|stdClass|int $post WP_Post instace or Post ID/object, which will be converted into WP_Post.
  * @return bool True when finished.
  */
 function setup_postdata( $post ) {
Index: tests/phpunit/tests/query/setupPostdata.php
===================================================================
--- tests/phpunit/tests/query/setupPostdata.php	(revision 34086)
+++ tests/phpunit/tests/query/setupPostdata.php	(working copy)
@@ -46,6 +46,22 @@
 		$this->assertSame( $p->ID, $GLOBALS['id'] );
 	}
 
+	public function test_setup_by_id() {
+		$p = $this->factory->post->create_and_get();
+		setup_postdata( $p->ID );
+
+		$this->assertNotEmpty( $p->ID );
+		$this->assertSame( $p->ID, $GLOBALS['id'] );
+	}
+
+	public function test_fake_post() {
+
+		$fake = new stdClass;
+		$fake->ID = 100;
+
+		$this->assertNotSame( $fake->ID, $GLOBALS['id'] );
+	}
+
 	public function test_authordata() {
 		$u = $this->factory->user->create_and_get();
 		$p = $this->factory->post->create_and_get( array(
