mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01: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. Built from https://develop.svn.wordpress.org/trunk@50232 git-svn-id: http://core.svn.wordpress.org/trunk@49893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a8d455a78f
commit
1aca7e8b25
@ -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;
|
||||
}
|
||||
|
||||
|
2
wp-includes/js/autosave.min.js
vendored
2
wp-includes/js/autosave.min.js
vendored
File diff suppressed because one or more lines are too long
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.7-beta1-50231';
|
||||
$wp_version = '5.7-beta1-50232';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user