How to Create a WordPress TinyMCE Plugin
If you are WordPress developer, then at some point you may come across customizing or extending the WordPress Visual Editor. For example, you may want to add a button to the Visual Editor’s toolbar to allow your client to easily insert a text box or a call to action button without writing any HTML code. In this article, we will show you how to create a TinyMCE plugin in WordPress.
TinyMCE Advanced introduces a “Classic Paragraph” block and a “Hybrid Mode” for the new block editor (Gutenberg).
If you are not quite ready to switch to the block editor, or have plugins that cannot be used there (yet), using the Classic Paragraph block and Hybrid Mode is your best option. It lets you to continue to use the familiar TinyMCE editor for most tasks, and at the same time gives you full access to all blocks and new features in the block editor.
Create a plugin for TinyMCE
First create a directory in the TinyMCE plugins directory. TinyMCE loads the plugin.js file when developers use the tinymce.js file in the page. Similarly, the tinymce.min.js loads the plugin.min.js file. The recommended usage is to use the tinymce.js file while developing and then use a build script minifying the plugin.js into plugin.min.js in production.
Using The TinyMCE Editor In WordPress [Guide]
Although they may not know its name, everyone who uses WordPress is familiar with the TinyMCE editor. It’s the editor you use when you create or edit your content – the one with the buttons for creating bold text, headings, text alignment and so on is. That’s what we’ll be taking a look at in this post, and I’m going to show you how you can add functionality and how you can use it in your plugins.