From 322382ae61f2c127b908ef300c65f8c25a62ff7b Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Fri, 11 Feb 2005 03:36:49 +0000 Subject: [PATCH] Allow setting of post_parent - http://mosquito.wordpress.org/view.php?id=111 git-svn-id: https://develop.svn.wordpress.org/trunk@2269 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions-post.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions-post.php b/wp-includes/functions-post.php index dcac36bb22..e9edea2b4a 100644 --- a/wp-includes/functions-post.php +++ b/wp-includes/functions-post.php @@ -34,10 +34,12 @@ function wp_insert_post($postarr = array()) { $comment_status = get_settings('default_comment_status'); if (empty($ping_status)) $ping_status = get_settings('default_ping_status'); + if ( empty($post_parent) ) + $post_parent = 0; $sql = "INSERT INTO $wpdb->posts - (post_author, post_date, post_date_gmt, post_modified, post_modified_gmt, post_content, post_title, post_excerpt, post_category, post_status, post_name, comment_status, ping_status) - VALUES ('$post_author', '$post_date', '$post_date_gmt', '$post_date', '$post_date_gmt', '$post_content', '$post_title', '$post_excerpt', '$post_cat', '$post_status', '$post_name', '$comment_status', '$ping_status')"; + (post_author, post_date, post_date_gmt, post_modified, post_modified_gmt, post_content, post_title, post_excerpt, post_category, post_status, post_name, comment_status, ping_status, post_parent) + VALUES ('$post_author', '$post_date', '$post_date_gmt', '$post_date', '$post_date_gmt', '$post_content', '$post_title', '$post_excerpt', '$post_cat', '$post_status', '$post_name', '$comment_status', '$ping_status', '$post_parent')"; $result = $wpdb->query($sql); $post_ID = $wpdb->insert_id;