TinyMCE: respect the Disable the visual editor when writing user setting and don't output the TinyMCE components when using wp_enqueue_editor().

Fixes #40960 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@40991 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2017-07-01 21:30:10 +00:00
parent 0d9dbc2fea
commit 02f0ddc844
2 changed files with 65 additions and 43 deletions

View File

@@ -115,6 +115,15 @@ wp.textWidgets = ( function( $ ) {
return;
}
// The user has disabled TinyMCE.
if ( typeof window.tinymce === 'undefined' ) {
wp.editor.initialize( id, {
quicktags: true
});
return;
}
// Destroy any existing editor so that it can be re-initialized after a widget-updated event.
if ( tinymce.get( id ) ) {
restoreTextMode = tinymce.get( id ).isHidden();