Skip to content

Commit

Permalink
Remove code to ensure tinymce save
Browse files Browse the repository at this point in the history
  • Loading branch information
rilwis committed Jan 8, 2021
1 parent 3741d15 commit d29f498
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions js/wysiwyg.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,6 @@
.find( '.quicktags-toolbar' ).attr( 'id', 'qt_' + id + '_toolbar' ).html( '' );
}

/**
* Handles updating tiny mce instances when saving a gutenberg post.
* https://metabox.io/support/topic/data-are-not-saved-into-the-database/
* https://github.com/WordPress/gutenberg/issues/7176
*/
function ensureSave() {
if ( !wp.data || !wp.data.hasOwnProperty( 'subscribe' ) || !window.tinyMCE ) {
return;
}
wp.data.subscribe( function() {
var editor = wp.data.hasOwnProperty( 'select' ) ? wp.data.select( 'core/editor' ) : {};

if ( editor && editor.isSavingPost && editor.isSavingPost() ) {
window.tinyMCE.triggerSave();
}
} );
}

function init( e ) {
$( e.target ).find( '.rwmb-wysiwyg' ).each( transform );
}
Expand All @@ -167,7 +149,6 @@
}, 0 );
} );

ensureSave();
rwmb.$document
.on( 'mb_blocks_edit', init )
.on( 'mb_init_editors', init )
Expand Down

0 comments on commit d29f498

Please sign in to comment.