I'm trying to add a custom button or two to the TinyMCE rich text editor. The tutorials I've seen so far are either outdated or explain how to do it with a custom plugin. How can I do this without creating a plugin, perhaps in the functions.php file instead? To be specific, I want to add a "h2" button that will add in a <h2></h2> into the body.
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
|
|||
|
|
|
It is almost code golf, but this is the smallest piece of code that I could up with that will create a button on the Visual editor to turn the current paragraph in a
It is based on a TinyMCE code sample and uses a trick to pass a function as the To add a button to the HTML editor you can extend the much simpler "quicktags" code by enqueuing this extra Javascript file:
|
|||||||||||
|