From e216db1950195cf944f73cdee3fdec7184af93d3 Mon Sep 17 00:00:00 2001 From: nacin Date: Sun, 18 Sep 2011 23:23:39 +0000 Subject: [PATCH] Fix issue where post locks were not updating on autosaves. props benbalter, fixes #18642. see #18515 for more on locking. broken in [12991], see #11889. git-svn-id: http://svn.automattic.com/wordpress/trunk@18709 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-ajax.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index a22751a021..2351958b85 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -982,13 +982,13 @@ case 'autosave' : // The name of this action is hardcoded in edit_post() } $data = $message; } else { - if ( isset( $_POST['auto_draft'] ) && '1' == $_POST['auto_draft'] ) + if ( ! empty( $_POST['auto_draft'] ) ) $id = 0; // This tells us it didn't actually save else $id = $post->ID; } - if ( $do_lock && ( isset( $_POST['auto_draft'] ) && ( $_POST['auto_draft'] != '1' ) ) && $id && is_numeric($id) ) + if ( $do_lock && empty( $_POST['auto_draft'] ) && $id && is_numeric( $id ) ) wp_set_post_lock( $id ); if ( $nonce_age == 2 ) {