--- wp-includes/functions-post.php 2006-01-29 14:58:48.000000000 -0500
+++ ../../wp-files-backup/functions-post.php 2006-05-13 23:29:12.000000000 -0400
@@ -16,11 +16,13 @@
// Are we updating or creating?
$update = false;
- if ( !empty($ID) ) {
- $update = true;
- $post = & get_post($ID);
- $previous_status = $post->post_status;
- }
+ // igorfoox
+ printf(__('In wp_insert_post, ID is %d'), $ID);
+// if ( !empty($ID) ) {
+// $update = true;
+// $post = & get_post($ID);
+// $previous_status = $post->post_status;
+// }
// Get the basics.
$post_content = apply_filters('content_save_pre', $post_content);
@@ -45,8 +47,8 @@
$post_status = 'draft';
// Get the post ID.
- if ( $update )
- $post_ID = $ID;
+ //if ( $update )
+ $post_ID = $ID;
// Create a valid post name. Drafts are allowed to have an empty
// post name.
@@ -120,6 +122,7 @@
}
if ($update) {
+ printf(__(' Running update query'));
$wpdb->query(
"UPDATE IGNORE $wpdb->posts SET
post_author = '$post_author',
@@ -142,12 +145,14 @@
menu_order = '$menu_order'
WHERE ID = $post_ID");
} else {
+ printf(__(' Running insert query'));
$wpdb->query(
"INSERT IGNORE INTO $wpdb->posts
- (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type)
+ (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, ID)
VALUES
- ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type')");
+ ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type', '$post_ID')");
$post_ID = $wpdb->insert_id;
+ printf(__('||| end of insertionn with id %d'), $post_id);
}
if ( empty($post_name) && 'draft' != $post_status ) {
--- wp-admin/import/mt.php 2006-01-01 17:54:56.000000000 -0500
+++ ../../wp-files-backup/mt.php 2006-05-13 23:30:53.000000000 -0400
@@ -222,6 +222,9 @@
case 'AUTHOR' :
$post_author = $value;
break;
+ case 'ID':
+ $ID = $value;
+ break;
case 'TITLE' :
$post_title = $wpdb->escape($value);
break;
@@ -281,8 +284,9 @@
$post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor
- $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt');
+ $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt', 'ID');
$post_id = wp_insert_post($postdata);
+ printf(__('Id was %d, wanted %d'), $post_id, $ID);
// Add categories.
if (0 != count($post_categories)) {
wp_create_categories($post_categories, $post_id);