From c148b6ce78dbc9fbbcf34702e8ec9a679ed1f715 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 2 Nov 2007 00:47:04 +0000 Subject: [PATCH] Make sure ID is set for later update() calls. git-svn-id: http://svn.automattic.com/wordpress/trunk@6305 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/post.php b/wp-includes/post.php index 88c1fc4c2..b8839de09 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -712,6 +712,9 @@ function wp_insert_post($postarr = array()) { $data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update $wpdb->insert( $wpdb->posts, $data ); $post_ID = (int) $wpdb->insert_id; + + /* use the newly genearted $post_ID */ + $where = array( 'ID' => $post_ID ); } if ( empty($post_name) && 'draft' != $post_status ) {