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

git-svn-id: https://develop.svn.wordpress.org/trunk@11840 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-08-19 02:30:42 +00:00
parent 1a2506c493
commit 34deab141b
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 ) ) {
$new_autosave = _wp_post_revision_fields( $_POST, true );
$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 );
}