git-svn-id: http://svn.automattic.com/wordpress/trunk@2122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2005-01-24 05:36:20 +00:00
parent ca285ec098
commit 36f89f11c9
1 changed files with 6 additions and 2 deletions

View File

@ -36,10 +36,14 @@ case 'post':
$post_status = $_POST['post_status'];
$post_name = $_POST['post_name'];
$post_parent = 0;
$menu_order = 0;
if ( isset($_POST['parent_id']) )
$post_parent = $_POST['parent_id'];
if ( isset($_POST['menu_order']) )
$menu_order = $_POST['menu_order'];
if ( empty($post_status) )
$post_status = 'draft';
// Double-check
@ -91,9 +95,9 @@ case 'post':
}
$postquery ="INSERT INTO $wpdb->posts
(ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt, post_parent)
(ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt, post_parent, menu_order)
VALUES
('$post_ID', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt', '$post_parent')
('$post_ID', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt', '$post_parent', '$menu_order')
";
$result = $wpdb->query($postquery);