How do I go about adding a simple button to tinymce on the default editor area of my new Custom Post Type?

I'd like the button, when clicked, to ask for a text value. The script should then lowercase the input and replace spaces with hyphens, and insert [glossary=value-entered] into the editor.

Thanks in advance,


Check out this tutorial on Pro Blog Design: http://www.problogdesign.com/wordpress/user-friendly-short-codes-with-tinymce/

  • That is a tutorial and a half... ! Thanks very much, looks like exactly what I need.
    – turbonerd
    Feb 8 '12 at 23:12

Have you read this?


  • I actually hadn't. Is that up to date? Is it simply a case of writing a tinyMCE plugin then using that WP code to load it?
    – turbonerd
    Feb 8 '12 at 22:55
  • That is up to date. It is as you say, writing a TinyMCE plugin and calling that with the WP code. That is how I've done it in the past. Feb 9 '12 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.