Adding a button to WordPress Image Toolbar in Post Editor
-
There are a few stackoverflow threads for this and a few topics around the internet, but i wasnt able to find a good definitive solutions:
What i want to do is to add a button to the Image toolbar which WordPress provides in post editor, as illustrated below.
The button circled in red is what i want to add. This button will trigger a jQuery code which fires off a modal for doing a certain operation.
I found a way to do it, but i definitely think that this is not a good way to do it:
Inline Image Toolbar seems to be a WordPress core feature which is added to tinymce as a plugin. I wasnt able to modify this, so what i did was to overwrite this entire plugin with the same code, but with my button added. So i added a tinymce plugin which overwrites this tinymce plugin.
I believe it would be better to add my button to the existing WordPress core tinymce plugin somehow. But im not sure if this is possible (to add plugins to tinmyce plugins).
If anyone can show pointers for a best practice to how to solve this, i’ll greatly appreciate it.
- The topic ‘Adding a button to WordPress Image Toolbar in Post Editor’ is closed to new replies.