Replace $user_id removed in [23889] with a direct function call. see #23665.

git-svn-id: https://develop.svn.wordpress.org/trunk@23890 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-04-03 04:37:50 +00:00
parent 085141a6ba
commit 50dffde71f
1 changed files with 1 additions and 1 deletions

View File

@ -1062,7 +1062,7 @@ function wp_ajax_autosave() {
if ( ! empty( $_POST['autosave'] ) ) {
// Drafts and auto-drafts are just overwritten by autosave for the same user
if ( $user_id == $post->post_author && ( 'auto-draft' == $post->post_status || 'draft' == $post->post_status ) ) {
if ( get_current_user_id() == $post->post_author && ( 'auto-draft' == $post->post_status || 'draft' == $post->post_status ) ) {
$id = edit_post();
} else { // Non drafts are not overwritten. The autosave is stored in a special post revision for each user.
$revision_id = wp_create_post_autosave( $post->ID );