mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Editor: Correct the check for unsaved content in wp.autosave.server.postChanged().
This fixes improper triggering of the "Are you sure?" prompt when navigating away from the old, "classic" Edit Post screen and there are no changes. The previous check did not account for Pages or any custom post types that don't have a Title, Content, or Excerpt field. Follow-up to [50031]. Props hwk-fr, mukesh27, audrasjb, archon810, Clorith, ibiza69, tonysandwich, roger995, bartosz777, viablethought, dbtedg, worldedu, hmabpera, magnuswebdesign. Fixes #52440. git-svn-id: https://develop.svn.wordpress.org/trunk@50232 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a07d734d77
commit
b301fa3d42
@ -710,7 +710,7 @@ window.autosave = function() {
|
||||
var editor = window.tinymce.get( field );
|
||||
|
||||
if ( ! editor || editor.isHidden() ) {
|
||||
if ( $( '#' + field ).val() !== initialCompareData[ field ] ) {
|
||||
if ( ( $( '#' + field ).val() || '' ) !== initialCompareData[ field ] ) {
|
||||
changed = true;
|
||||
// Break.
|
||||
return false;
|
||||
@ -721,7 +721,7 @@ window.autosave = function() {
|
||||
}
|
||||
} );
|
||||
|
||||
if ( $( '#title' ).val() !== initialCompareData.post_title ) {
|
||||
if ( ( $( '#title' ).val() || '' ) !== initialCompareData.post_title ) {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user