Changeset 29572
- Timestamp:
- 08/22/2014 12:24:56 AM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/post.php
r28312 r29572 230 230 231 231 // Session cookie flag that the post was saved 232 if ( isset( $_COOKIE['wp-saving-post-' . $post_id] ) ) 233 setcookie( 'wp-saving-post-' . $post_id, 'saved' ); 232 if ( isset( $_COOKIE['wp-saving-post'] ) && $_COOKIE['wp-saving-post'] === $post_id . '-check' ) { 233 setcookie( 'wp-saving-post', $post_id . '-saved', time() + DAY_IN_SECONDS ); 234 } 234 235 235 236 redirect_post($post_id); // Send user on their way while we keep working -
trunk/src/wp-includes/js/autosave.js
r29192 r29572 287 287 } 288 288 289 wpCookies.set( 'wp-saving-post -' + post_id, 'check');289 wpCookies.set( 'wp-saving-post', post_id + '-check', 24 * 60 * 60 ); 290 290 }); 291 291 } … … 310 310 var content, post_title, excerpt, $notice, 311 311 postData = getSavedPostData(), 312 cookie = wpCookies.get( 'wp-saving-post-' + post_id ); 312 cookie = wpCookies.get( 'wp-saving-post' ); 313 314 if ( cookie === post_id + '-saved' ) { 315 wpCookies.remove( 'wp-saving-post' ); 316 // The post was saved properly, remove old data and bail 317 setData( false ); 318 return; 319 } 313 320 314 321 if ( ! postData ) { 315 322 return; 316 }317 318 if ( cookie ) {319 wpCookies.remove( 'wp-saving-post-' + post_id );320 321 if ( cookie === 'saved' ) {322 // The post was saved properly, remove old data and bail323 setData( false );324 return;325 }326 323 } 327 324 … … 335 332 excerpt = $( '#excerpt' ).val() || ''; 336 333 337 // cookie == 'check' means the post was not saved properly, always show #local-storage-notice 338 if ( cookie !== 'check' && compare( content, postData.content ) && 339 compare( post_title, postData.post_title ) && compare( excerpt, postData.excerpt ) ) { 334 if ( compare( content, postData.content ) && compare( post_title, postData.post_title ) && 335 compare( excerpt, postData.excerpt ) ) { 340 336 341 337 return;
Note: See TracChangeset
for help on using the changeset viewer.