git-svn-id: http://svn.automattic.com/wordpress/trunk@2172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2005-01-31 10:32:28 +00:00
parent ca2815fb70
commit c4d8b5c8b4
1 changed files with 11 additions and 1 deletions

View File

@ -44,6 +44,16 @@ case 'post':
if ( isset($_POST['menu_order']) )
$menu_order = $_POST['menu_order'];
if (! empty($_POST['post_author_override'])) {
$post_author = (int) $_POST['post_author_override'];
} else if (! empty($_POST['post_author'])) {
$post_author = (int) $_POST['post_author'];
} else {
$post_author = (int) $_POST['user_ID'];
}
if ( !user_can_edit_user($user_ID, $post_author) )
die( __('You cannot post as this user.') );
if ( empty($post_status) )
$post_status = 'draft';
// Double-check
@ -97,7 +107,7 @@ 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, 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', '$menu_order')
('$post_ID', '$post_author', '$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);