Autosave: Don't save an autosave unnecessarily when the post editor loads and TinyMCE is the default editor.
Delete such useless autosaves when we detect them in edit-form-advanced.php. see #7392. git-svn-id: http://core.svn.wordpress.org/trunk@24787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
af708b5a71
commit
85cf232e23
|
@ -98,6 +98,9 @@ if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql
|
|||
break;
|
||||
}
|
||||
}
|
||||
// If this autosave isn't different from the current post, begone.
|
||||
if ( ! $notice )
|
||||
wp_delete_post_revision( $autosave->ID );
|
||||
unset($autosave_field, $_autosave_field);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,15 @@ jQuery(document).ready( function($) {
|
|||
if ( 'content' == editor.id ) {
|
||||
editor.onLoad.add( function() {
|
||||
editor.save();
|
||||
if ( typeof switchEditors != 'undefined' ) {
|
||||
autosaveLast = wp.autosave.getCompareString({
|
||||
post_title : $('#title').val() || '',
|
||||
content : switchEditors.pre_wpautop( $('#content').val() ) || '',
|
||||
excerpt : $('#excerpt').val() || '',
|
||||
});
|
||||
} else {
|
||||
autosaveLast = wp.autosave.getCompareString();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue