Please remember that the frontend editor usage is restricted to logged-in users with editing capabilities for post+pages (admin+manager) by default - to change that behaviour you can simply use the filter hook enlighter_frontend_editing
The automatic integration requires the following conditions:
- Enabled frontend integration flag (Settings -> Editing -> TinyMCE -> Frontend Integration)
- The editor has to be added via the standard wp_editor function
- The first toolbar is not overridden with custom settings
- Frontend editing is limited to users with the standard WordPress permissions
edit_post
oredit_pages
. You can change this security condition by invoking the filter enlighter_frontend_editing
see bbPress
In case your plugins doesn't fulfill all previous mentioned requirements it is also possible to add the EnlighterJS editor plugin manually - this required advanced knowledge in php and javascript!
The editor plugin has its own repository on GitHub
Dependencies
The plugin dependencies have to be available on your website.
In case you're already using the Enlighter plugin they are located in wp-content/plugins/enlighter/resources/tinymce
Direct initialization via tinymce
// initialize TinyMCE
tinymce.init({
// paste plugin is required to strip pasted wysiwyg content (drop formats!)
plugins: 'paste',
external_plugins: {
'enlighterjs': '/wp-content/plugins/enlighter/resources/tinymce/enlighterjs.tinymce.min.js'
},
content_css: "/wp-content/plugins/enlighter/resources/tinymce/enlighterjs.tinymce.min.css",
selector: '#editor1',
menubar: false,
height: 1200,
toolbar: 'styleselect | bold italic | link image | pastetext | EnlighterInsert EnlighterEdit'
});
Indirect initialization via wp.editor
// initialize TinyMCE
wp.editor.initialize('editor1', {
'tinymce': {
// paste plugin is required to strip pasted wysiwyg content (drop formats!)
plugins: 'paste',
external_plugins: {
'enlighterjs': '/wp-content/plugins/enlighter/resources/tinymce/enlighterjs.tinymce.min.js'
},
content_css: "/wp-content/plugins/enlighter/resources/tinymce/enlighterjs.tinymce.min.css",
toolbar: 'styleselect | bold italic | link image | pastetext | EnlighterInsert EnlighterEdit'
}
});