Local autosave: set a temp cookie on submitting the form and change it on redirecting after the post is saved/updated, then use it to determine if saving worked properly. Removes the chance for false positives after saving/updating a post. See #23220

git-svn-id: https://develop.svn.wordpress.org/trunk@23693 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2013-03-14 03:06:07 +00:00
parent a1ae5c0d28
commit 5e71fb3992
2 changed files with 24 additions and 37 deletions
+4
View File
@@ -210,6 +210,10 @@ case 'editpost':
$post_id = edit_post();
// Session cookie flag that the post was saved
if ( isset( $_COOKIE['wp-saving-post-' . $post_id] ) )
setcookie( 'wp-saving-post-' . $post_id, 'saved' );
redirect_post($post_id); // Send user on their way while we keep working
exit();