I would like to add a button to this toolbar, right of “fullscreen”:
The button should add this: ââ
If text is selected, it should get around the text, like this: âselected textâ
How can I add such a button to the ed_toolbar (class: quicktags-toolbar)?
Try adding the following code in your function.php
The new, recommended way to add buttons to the toolbar is via the Quicktags API. Furthermore the site GenerateWP provides a handy code generator, which for this example creates the following:
Note also that
QTags
also allows you to call JavaScript from buttons; the simplest example given is: