Make WordPress Core

Ticket #7392: 7392.4.diff

File 7392.4.diff, 1.1 KB (added by nacin, 12 years ago)
  • wp-admin/edit-form-advanced.php

     
    9898                        break;
    9999                }
    100100        }
     101        // If this autosave isn't different from the current post, begone.
     102        if ( ! $notice )
     103                wp_delete_post_revision( $autosave->ID );
    101104        unset($autosave_field, $_autosave_field);
    102105}
    103106
  • wp-includes/js/autosave.js

     
    77                        if ( 'content' == editor.id ) {
    88                                editor.onLoad.add( function() {
    99                                        editor.save();
    10                                         autosaveLast = wp.autosave.getCompareString();
     10                                        if ( typeof switchEditors != 'undefined' ) {
     11                                                autosaveLast = wp.autosave.getCompareString({
     12                                                        post_title : $('#title').val() || '',
     13                                                        content : switchEditors.pre_wpautop( $('#content').val() ) || '',
     14                                                        excerpt : $('#excerpt').val() || '',
     15                                                });
     16                                        } else {
     17                                                autosaveLast = wp.autosave.getCompareString();
     18                                        }
    1119                                });
    1220                        }
    1321                });