Index: src/wp-includes/query.php
===================================================================
--- src/wp-includes/query.php	(revision 31834)
+++ src/wp-includes/query.php	(working copy)
@@ -4568,12 +4568,16 @@
 	 *
 	 * @since 4.1.0
 	 *
-	 * @param WP_Post $post Post data.
+	 * @param WP_Post $p Post data or post ID.
 	 * @return bool 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);
