Use the current user as author for autosave, fixes #10004

git-svn-id: http://svn.automattic.com/wordpress/trunk@11840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-08-19 02:30:42 +00:00
parent 91ef366300
commit 4c13a5acf4
1 changed files with 2 additions and 0 deletions

View File

@ -1091,6 +1091,8 @@ function wp_create_post_autosave( $post_id ) {
if ( $old_autosave = wp_get_post_autosave( $post_id ) ) { if ( $old_autosave = wp_get_post_autosave( $post_id ) ) {
$new_autosave = _wp_post_revision_fields( $_POST, true ); $new_autosave = _wp_post_revision_fields( $_POST, true );
$new_autosave['ID'] = $old_autosave->ID; $new_autosave['ID'] = $old_autosave->ID;
$current_user = wp_get_current_user();
$new_autosave['post_author'] = $current_user->ID;
return wp_update_post( $new_autosave ); return wp_update_post( $new_autosave );
} }