=== Editor42 ===
Contributors: editor42
Tags: classic editor, disable gutenberg, tinymce, rich text editor, wysiwyg
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.0
Requires CP: 2.0
Stable tag: 1.0.0
License: MIT
License URI: https://opensource.org/licenses/MIT

Up-to-date TinyMCE fork: a WYSIWYG block for the block editor, the full classic editor screen, or both. Free and MIT licensed.

== Description ==

Editor42 brings modern classic editing to WordPress, your way. Out of the box it adds an Editor42 block to the block editor (Gutenberg): free-form rich text with a real toolbar, right between your other blocks. Flip one switch and it goes further, disabling the block editor and restoring the full classic editing screen. Editor42 is a free, MIT licensed fork of TinyMCE with security fixes, so either way you get an actively maintained WYSIWYG rich text editor with the workflow you already know.

**Why replace the TinyMCE in WordPress**

WordPress still edits classic content with an outdated TinyMCE: version 4.9.11, released in July 2020 and the last TinyMCE 4 there is. The classic editor, the Classic block and the visual editor fields of themes and plugins all run on it. TinyMCE's later releases fixed a series of cross-site scripting (XSS) issues, and none of those fixes was ever released for TinyMCE 4. Editor42 is an up-to-date fork with those fixes, and it keeps getting updates.

The plugin is fully self-contained. It ships its own editor and never depends on the TinyMCE copy inside WordPress core, so it keeps working on future WordPress versions that no longer load one. There are no accounts and no cloud requests; the plugin itself loads nothing from outside your site.

The plugin's own code ships as readable source. The bundled engine is Editor42 42.0.0, shipped minified with the readable file next to every minified one; its source is the editor42 branch of https://github.com/editor42com/editor42 (its 42.0.0 release commit) and its built files are https://github.com/editor42com/editor42-dist (tag 42.0.0). The FAQ has the build steps.

**What you get**

* An Editor42 block for the block editor: free-form rich text stored as plain HTML, with its own section at the top of the block inserter, a toolbar that stays in view while you scroll a long text, and fullscreen editing over the whole window. It edits in place wherever the block editor shows it: posts and pages, the Site Editor, the pattern editor and the device previews.
* Turn a Classic block, paragraphs, headings, lists, quotes and other text blocks into an Editor42 block, several at once too, and turn it back into separate blocks with one click.
* A Default editor switch: keep the block editor with the Editor42 block, or disable it and bring the classic editing screen back. Everything is reversible: switch back or deactivate, and your editors are stock again while your content stays plain HTML.
* Editor42 in every classic editor area if you want it there: product descriptions, text widgets and other plugin fields (on by default, one checkbox to turn off). A field that asks for the lean toolbar or for no Add Media button gets exactly that.
* A rich toolbar out of the box: two rows with tables, colors, emoji, code view, find and replace, accordions and more, with the menubar above it. A leaner Simple preset is one click away, and the menubar has a switch of its own.
* A drag and drop toolbar configurator: arrange the buttons and the lines your way, by mouse or by keyboard, and load a built-in preset any time.
* The WordPress media library wherever a picture comes in: Add Media, the Browse button of the image dialog, and pictures you paste or drop into the text, which are uploaded to the library. Image alignment and captions are stored exactly as the classic editor stored them, and the older [caption] spellings are read too.
* The WordPress link dialog with search over your existing posts and pages.
* The Text/HTML tab with quicktags, next to the Visual tab.
* Live previews for galleries, embeds and media shortcodes right in the editor, with the shortcode text preserved byte for byte.
* Insert/edit media on the Full-featured toolbar: a video or audio file gets a player, and a link to YouTube, Vimeo or any other site WordPress can embed is stored as the link on its own line, so the site embeds it the WordPress way for every user role.
* Every wp_editor() spot that asks for a visual editor is covered: Text widgets (with their Visual/Text tabs and Add Media), WooCommerce product descriptions and other plugin integrations. Spots that never had a visual editor, like comment editing and bbPress forms, stay exactly as they are.
* A right-to-left site gets a right-to-left editor.
* Full compatibility with ClassicPress 2.x.

**Content stays yours**

Content is stored the way the classic editor always stored it: standard HTML in post_content, paragraphs restored by wpautop on output, captions as the regular [caption] shortcode. Whatever the classic editor kept is kept here too: icon fonts, the empty lines between paragraphs, and the style blocks and embeds WordPress lets a user add. Scripts are the one exception: a script inside a post is dropped when the post is edited in Visual mode. A post written in the block editor keeps its blocks when you open and save it on the classic screen. Nothing proprietary is written into your posts or your database: the plugin stores one option, and uninstalling removes it.

== Installation ==

1. In your admin, open Plugins > Add Plugin and search for Editor42.
2. Press Install Now, then Activate.

A plugin zip installs the same way through Plugins > Add Plugin > Upload Plugin.

The block editor now offers the Editor42 block. To open posts and pages in Editor42 instead, choose Editor42 as the main editor on Settings > Editor42. Try the block first; you can switch back at any time. On ClassicPress, Editor42 is the editor as soon as it is active.

== Frequently Asked Questions ==

= Does this disable Gutenberg? =

Only if you ask it to. By default the block editor stays and the plugin adds an Editor42 block to it. Choose Editor42 as the default editor in Settings > Editor42 and the block editor is disabled for posts, pages and custom post types, with the classic editing screen in its place. Switch back or deactivate and the block editor returns.

= Do I still need the Classic Editor plugin? =

No. Choose Editor42 as the main editor on Settings > Editor42 and the block editor is disabled for posts, pages and custom post types, with the classic editing screen in its place: that is what the Classic Editor plugin does, so you can deactivate it. Kept active with its default settings, the classic screen it brings back runs Editor42 too. If it lets users switch editors, Editor42 as the main editor opens every post on the classic screen, and with Only a Gutenberg block chosen its classic screen keeps the stock TinyMCE.

= What is the Editor42 block? =

A free-form rich text block edited with the bundled Editor42 engine, with the same toolbar you configure for the classic screen. Its content is stored as plain HTML, like the classic editor stored it, so nothing proprietary ends up in your posts. Its text is drawn with your theme's styles, the way the site draws it and the blocks around it are drawn (the classic screen does the same with a theme that has a theme.json). It is a regular block of the current block API, so it edits in place in the Site Editor, the pattern editor and the device previews too, and the block editor's own shortcuts (Ctrl+S to save, the list view, the settings sidebar, removing or moving the block) work from inside its text. Strikethrough, inline code and removing a link answer to the same keys as in the block editor: Shift+Alt+D, Shift+Alt+X and Ctrl+Shift+K.

= How is the Editor42 block different from the Classic block? =

The Classic block edits with the TinyMCE 4.9.11 inside WordPress, in a popup since WordPress 7.0. The Editor42 block edits in place with the bundled engine and the toolbar you configure: tables, colors, find and replace, the source code view, fullscreen. You can turn a Classic block into an Editor42 block and back at any time.

= Is this the same TinyMCE as the old classic editor? =

It is the same kind of editor with the same conventions, but a newer engine. Editor42 is a maintained, MIT licensed fork of TinyMCE with security fixes, bundled inside the plugin. Your content round-trips exactly as it did with the classic editor.

= Will my existing content change? =

No. Content is stored as standard post_content HTML in the classic form. Posts written before the switch open and save without modification, and posts written with Editor42 stay valid if you ever deactivate it. A post made of Editor42 blocks keeps rendering on your site without the plugin; in the block editor those blocks then show as blocks WordPress does not recognize, and one click keeps them as HTML.

= I use a plugin that adds buttons to the classic editor. Where are they? =

Buttons other plugins add through the mce_buttons and mce_external_plugins filters are written for the TinyMCE inside WordPress core. Editor42 is a newer engine and does not load them. A plugin can offer its button to Editor42 through two filters: editor42_toolbar_buttons adds the button to the list the configurator offers (its name, label and the engine plugin it needs), and editor42_external_plugins names that engine plugin's script URL. The button then appears in the toolbar configurator like any other, and its script loads wherever the toolbar shows it. The README inside the plugin has an example.

= Can I use it with Advanced Editor Tools (TinyMCE Advanced)? =

Yes, both can stay active. Advanced Editor Tools sets up the TinyMCE inside WordPress core, so its toolbar settings apply where that TinyMCE still runs, such as the Classic block, and not where Editor42 runs. Editor42 brings its own: tables, text and background colors, find and replace, the source code view and a toolbar you arrange yourself on Settings > Editor42.

= Does it phone home or load anything from a CDN? =

No. Everything the plugin uses ships inside the plugin and loads from your own site; there are no accounts and no tracking. The only requests that leave your site are the ones the classic editor made too: the preview of an embedded video or tweet is fetched from its provider. The status bar of the editor in wp-admin carries a link to editor42.com; an editor on the front end of your site shows none.

= Where is the source code? =

The plugin's own PHP, JavaScript and CSS ship unminified. The bundled Editor42 engine (version 42.0.0) ships both ways: next to every .min.js and .min.css file in assets/editor42/ sits the readable file it was made from (editor42.js, plugins/*/plugin.js, themes/silver/theme.js, skins/*/*.css and so on). The engine's source code is at https://github.com/editor42com/editor42, branch editor42, at its 42.0.0 release commit; the built files are at https://github.com/editor42com/editor42-dist, tag 42.0.0. To build it yourself, clone the source, check out the editor42 branch and run yarn, then yarn build; the output lands in modules/editor42/js/editor42/. assets/editor42/ is that output as published in editor42-dist, without the README, package.json, composer.json and typings, the codesample plugin and the emoji image set.

= Can I choose which buttons are on the toolbar? =

Yes. Settings > Editor42 has two built-in presets (Full-featured and Simple) and a drag and drop configurator for your own layout, lines included; while you drag, the button shows where it will land. The menubar is a separate switch. The configurator is fully keyboard accessible.

= Does it work with ClassicPress? =

Yes, ClassicPress 2.x is supported and tested. There is no block editor there, so the block and the Default editor choice do not apply: Editor42 replaces the bundled classic editor, and deactivating the plugin brings the stock TinyMCE back if you ever want it.

== Screenshots ==

1. The Editor42 block inside the block editor: free-form rich text with its toolbar on one row, the rest one click away.
2. The classic editing screen with the Full-featured toolbar, a captioned image and a live gallery preview.
3. The toolbar configurator on Settings > Editor42: arrange the buttons on a toolbar that looks exactly like the editor's.
4. The Default editor switch, the classic areas checkbox and the Menubar checkbox on Settings > Editor42.

== Changelog ==

= 1.0.0 =
* First release: the Editor42 block for the block editor, the Default editor switch (keep the block editor or bring the classic editing screen back), the bundled Editor42 engine on the classic screen, media library and caption support (the older [caption] spellings included), the WordPress link dialog, the Text/HTML tab, two toolbar presets with a drag and drop configurator, live shortcode and embed previews, Editor42 in classic editor areas (product descriptions, text widgets with their tabs and Add Media, plugin fields, with their lean toolbar and no Add Media requests respected), right-to-left support, ClassicPress 2.x support.
* The Editor42 block: its own inserter section, conversion from other text blocks and back, a toolbar that stays in view on long texts, fullscreen editing over the whole window, its text in automatic excerpts, in-place editing in the Site Editor, the pattern editor and the device previews, and the block editor's shortcuts from inside its text.
* Pictures pasted or dropped into the editor are uploaded to the media library, and the image and media dialogs browse the library.
* Insert/edit media on the Full-featured toolbar: players for video and audio files; a link to a site WordPress can embed is stored as the link, so every role keeps it and the site embeds it.
* Classic content comes through as the classic editor left it: icon fonts, bold and style blocks as written, spacer lines, inline pictures, and the iframes and objects WordPress lets a user add. Scripts are never kept.
* One Read More tag per post: inserting it again moves it.
* The text wears the theme's styles while you edit, in the block like the core blocks around it and on the classic screen like the site (a theme with a theme.json).
* Settings: the menubar as a switch of its own, and a toolbar configurator that previews where a dragged button lands and lets you reorder the lines.

== Upgrade Notice ==

= 1.0.0 =
First release.
