Skip to content
This repository has been archived by the owner on Oct 21, 2019. It is now read-only.

Latest commit

 

History

History
33 lines (17 loc) · 1.55 KB

tinymce-toolbar-button.md

File metadata and controls

33 lines (17 loc) · 1.55 KB

TinyMCE Toolbar Button

Covers the following TinyMCE API:

  • tinymce.activeEditor.addButton()

Overview

TinyMCE includes an API for registering custom buttons to its toolbar. These buttons appear alongside existing TinyMCE rich formatting buttons.

Custom buttons can be used to insert and programmatically manipulate post content. They often use the TinyMCE Editor set of APIs.

Existing Usage

From WordPress/gutenberg#4658, the following screenshot depicts a TinyMCE button that wraps some text with an indicator to highlight it for social sharing:

image


From #3, the following screenshot depicts a TinyMCE button that inserts an inline shortcode:

image

The button first opens a pop-up modal to present the user with some configuration options, and then inserts an inline shortcode with attributes filled out based on the user's selection.


Please open a new issue to suggest additional examples of existing usage.

Gutenberg Equivalent

While the Gutenberg Block API provides UI for inserting block-level elements, there are no Gutenberg equivalents for customizing the block toolbar or programmatically manipulating post content.