mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Allow setting of post_parent - http://mosquito.wordpress.org/view.php?id=111
git-svn-id: http://svn.automattic.com/wordpress/trunk@2269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2321f08139
commit
34da840f28
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user