Changes between Version 1 and Version 2 of Ticket #52440, comment 28
- Timestamp:
- 02/05/2021 08:39:10 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #52440, comment 28
v1 v2 4 4 - [https://core.trac.wordpress.org/raw-attachment/ticket/52440/2021-02-05_19h21_41.mp4 Video: Final Fix Behavior] 5 5 6 In the file `wp-includes/js/autosave.js:704`, rewrite the `postChanged()`to:6 For Core developers: In the file `wp-includes/js/autosave.js:709`, rewrite the `window.tinymce.each` loop to: 7 7 8 8 {{{#!js 9 function postChanged() {10 var changed = false;9 window.tinymce.each( [ 'content', 'excerpt' ], function( field ) { 10 var editor = window.tinymce.get( field ); 11 11 12 // If there are TinyMCE instances, loop through them. 13 if ( window.tinymce ) { 14 window.tinymce.each( [ 'content', 'excerpt' ], function( field ) { 15 var editor = window.tinymce.get( field ); 16 17 if ( ( editor && editor.isDirty() ) || ( $( '#' + field ).val() || '' ) !== initialCompareData[ field ] ) { 18 changed = true; 19 return false; 20 } 21 22 } ); 23 24 if ( $( '#title' ).val() !== initialCompareData.post_title ) { 25 changed = true; 26 } 27 28 return changed; 12 if ( ( editor && editor.isDirty() ) || ( $( '#' + field ).val() || '' ) !== initialCompareData[ field ] ) { 13 changed = true; 14 return false; 29 15 } 30 16 31 return getCompareString() !== initialCompareString; 32 } 17 } ); 33 18 }}} 34 19 35 Standalone fix for webmasters:In the `functions.php` file, add the following code.20 For Webmasters: Here is the Standalone Fix. In the `functions.php` file, add the following code. 36 21 37 22 {{{#!php