Make sure ID is set for later update() calls.

git-svn-id: https://develop.svn.wordpress.org/trunk@6305 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-11-02 00:47:04 +00:00
parent 60883171f5
commit 5308684211
1 changed files with 3 additions and 0 deletions

View File

@ -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 ) {