Adding an Editor Button for Easy Footnotes

Origin Story I saw Alan’s post this morning about footnotes in SPLOTs. He mentioned adding buttons to the WYSIWYG editor to help use Easy Footnotes . . . more easily . . . because, like me, he often forgets the shortcode structures. I figured I’d better get it made fast before Gutenberg renders all my current knowledge obsolete. Additionally, I like to try to pay Alan back for all the work he’s helped me with over the years. So here’s a plugin that should behave fairly well assuming you have Easy Footnotes installed and active. PHP Land A bit of scanning led me to this tutorial and from there we were off. This is mostly just enqueueing various scripts and pretty much copy/paste. I’m not currently doing anything with the admin CSS but likely will in the near future. Javascript Land The following JS builds the modal and assigns a tinymce editor to it. I’m debating whether that’s a good idea or not at this point. I can see some advantages to keeping bold and italic but maybe dropping everything else. You can see I’m using ?as the button text which might not be appreciated as the feet are very tiny and it is a very corny1 joke. This stuff feels closer to learning a templating language than programming to […] […]

Read More…

Privacy Statement