diff --git a/src/js/_enqueues/vendor/tinymce/plugins/wpemoji/plugin.js b/src/js/_enqueues/vendor/tinymce/plugins/wpemoji/plugin.js index ea6a62996c..7d3e4baaef 100644 --- a/src/js/_enqueues/vendor/tinymce/plugins/wpemoji/plugin.js +++ b/src/js/_enqueues/vendor/tinymce/plugins/wpemoji/plugin.js @@ -1,6 +1,8 @@ -( function( tinymce, wp, settings ) { +( function( tinymce ) { tinymce.PluginManager.add( 'wpemoji', function( editor ) { var typing, + wp = window.wp, + settings = window._wpemojiSettings, env = tinymce.Env, ua = window.navigator.userAgent, isWin = ua.indexOf( 'Windows' ) > -1, @@ -125,4 +127,4 @@ } } ); } ); -} )( window.tinymce, window.wp, window._wpemojiSettings ); +} )( window.tinymce ); diff --git a/src/js/_enqueues/vendor/tinymce/plugins/wpview/plugin.js b/src/js/_enqueues/vendor/tinymce/plugins/wpview/plugin.js index 25da4d04c5..1e3968d2c3 100644 --- a/src/js/_enqueues/vendor/tinymce/plugins/wpview/plugin.js +++ b/src/js/_enqueues/vendor/tinymce/plugins/wpview/plugin.js @@ -1,10 +1,13 @@ /** * WordPress View plugin. */ -( function( tinymce, wp ) { +( function( tinymce ) { tinymce.PluginManager.add( 'wpview', function( editor ) { function noop () {} + // Set this here as wp-tinymce.js may be loaded too early. + var wp = window.wp; + if ( ! wp || ! wp.mce || ! wp.mce.views ) { return { getView: noop @@ -199,4 +202,4 @@ getView: noop }; } ); -} )( window.tinymce, window.wp ); +} )( window.tinymce );