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:
parent
085141a6ba
commit
50dffde71f
|
@ -1062,7 +1062,7 @@ function wp_ajax_autosave() {
|
||||||
|
|
||||||
if ( ! empty( $_POST['autosave'] ) ) {
|
if ( ! empty( $_POST['autosave'] ) ) {
|
||||||
// Drafts and auto-drafts are just overwritten by autosave for the same user
|
// 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();
|
$id = edit_post();
|
||||||
} else { // Non drafts are not overwritten. The autosave is stored in a special post revision for each user.
|
} 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 );
|
$revision_id = wp_create_post_autosave( $post->ID );
|
||||||
|
|
Loading…
Reference in New Issue