Ticket #759: postauthor_post.diff
| File postauthor_post.diff, 1.4 KB (added by coffee2code, 8 years ago) |
|---|
-
post.php
old new 44 44 if ( isset($_POST['menu_order']) ) 45 45 $menu_order = $_POST['menu_order']; 46 46 47 if (! empty($_POST['post_author_override'])) { 48 $post_author = (int) $_POST['post_author_override']; 49 } else if (! empty($_POST['post_author'])) { 50 $post_author = (int) $_POST['post_author']; 51 } else { 52 $post_author = (int) $_POST['user_ID']; 53 } 54 if ( !user_can_edit_user($user_ID, $post_author) ) 55 die( __('You cannot post as this user.') ); 56 47 57 if ( empty($post_status) ) 48 58 $post_status = 'draft'; 49 59 // Double-check … … 97 107 $postquery ="INSERT INTO $wpdb->posts 98 108 (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) 99 109 VALUES 100 ('$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')110 ('$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') 101 111 "; 102 112 103 113 $result = $wpdb->query($postquery);