Changeset 7138
- Timestamp:
- 03/03/2008 08:58:06 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
wp-admin/admin-ajax.php (modified) (3 diffs)
-
wp-includes/js/autosave.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r7103 r7138 484 484 $do_lock = true; 485 485 486 $data = '<div class="updated"><p>' . sprintf( __('Saved at %s.'), date( __('g:i:s a'), current_time( 'timestamp', true ) ) ) . '</p></div>'; 486 $data = ''; 487 $message = '<div class="updated"><p>' . sprintf( __('Saved at %s.'), date( __('g:i:s a'), current_time( 'timestamp', true ) ) ) . '</p></div>'; 487 488 488 489 $supplemental = array(); … … 491 492 if($_POST['post_ID'] < 0) { 492 493 $_POST['temp_ID'] = $_POST['post_ID']; 493 if ( $do_autosave ) 494 if ( $do_autosave ) { 494 495 $id = wp_write_post(); 496 $data = $message; 497 } 495 498 } else { 496 499 $post_ID = (int) $_POST['post_ID']; … … 518 521 die(__('You are not allowed to edit this post.')); 519 522 } 520 if ( $do_autosave ) 523 if ( $do_autosave ) { 521 524 $id = wp_update_post($_POST); 522 else 525 $data = $message; 526 } else { 523 527 $id = $post->ID; 528 } 524 529 } 525 530 -
trunk/wp-includes/js/autosave.js
r7130 r7138 18 18 // called when autosaving pre-existing post 19 19 function autosave_saved(response) { 20 var oldMessage = jQuery('#autosave').html(); 20 21 var res = wpAjax.parseAjaxResponse(response, 'autosave'); // parse the ajax response 21 22 var message = ''; … … 39 40 } 40 41 if ( message ) { jQuery('#autosave').html(message); } // update autosave message 42 else if ( oldMessage && res ) { jQuery('#autosave').html( oldMessage ); } 41 43 autosave_enable_buttons(); // re-enable disabled form buttons 42 44 return res;
Note: See TracChangeset
for help on using the changeset viewer.