true, 'wp_autoresize_on' => true, 'add_unload_trigger' => false, 'wp_keep_scroll_position' => true, ]; /** * It is now possible to override the parameters sent to the * TinyMCE JS editor instance. * * @since 10.1.37 */ if (isset($params['tinymce'])) { // merge settings $editor = array_merge($editor, $params['tinymce']); // unset to avoid replacing the whole attribute while // merging the global settings unset($params['tinymce']); } $settings = array( 'media_buttons' => $buttons, '_content_editor_dfw' => true, 'drag_drop_upload' => true, 'tabfocus_elements' => 'content-html,save-post', 'editor_height' => $height, 'tinymce' => $editor, 'textarea_name' => $name, ); /** * It is now possible to override the parameters sent to the * WordPress TinyMCE editor instance. * * @since 10.1.37 */ $settings = array_merge($settings, $params); // init editor wp_editor($html, $id, $settings); $document = JFactory::getDocument(); /** * Inject TinyMCE instance within Joomla.editors pool. * * @since 10.1.17 */ $document->addScriptDeclaration( << { // once the tinyMCE instance is ready... return tinyMCE.get('$id'); }).then((editor) => { // ...register it into the CMS editors pool Joomla.editors.instances['$id'].instance = editor; }); }); })(jQuery); JS ); // if we are doing AJAX, render the editor via javascript if (wp_doing_ajax()) { $document->addScriptDeclaration( <<