OK, I may have found the solution (I’m not 100% on this, so verification from someone else would be greatly appreciated!) and am posting it here so that others searching for the same problem might find my solution helpful.
- Visit http://tinymce.moxiecode.com/tinymce/docs/reference_buttons.html to find the name of the button you are interested in added. In my case, I wanted to add a method for applying a format to a paragraph (h1, h2, etc.) this is called “formatselect.”
- Open the file “tiny_mce_gzip.php” in the “tinymce” folder within the “js” folder that’s within the “wp-includes” folder. So, it’s wp-includes>js>tinymce>tiny_mce_gzip.php
- Find the code that reads:
$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright' ,'separator', 'link', 'unlink', 'image', 'wordpress', 'separator', 'undo', 'redo', 'code', 'wphelp'));
- Add the button name that you wish to have show up in the button array. In my case, I wanted “formatselect” so I modified the code to display as:
$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'formatselect', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright' ,'separator', 'link', 'unlink', 'image', 'wordpress', 'separator', 'undo', 'redo', 'code', 'wphelp'));
(adding both “formatselect” and a separator)
That’s it!
wow, you’re a good friend!
Best to not modify the core and instead make a mini-plugin like this one.
Or if you want to add totally custom buttons like I’ve done, just use the great PHP class called ButtonSnap.
Viper007Bond: THANK YOU.
Thank you, thank you, thank you.
In all my searching, I never saw that “mini-plugin.” It is absolutely perfect; and, from what I’ve seen in these support forums, a plug-in for which many more people are looking. Hopefully, this post will help them find it.
(also: your video Quicktag plug-in looks quite good. I’ll download that for future reference!)
Hey Viper,
Thanks for the link. Got really fed up searching for how exactly to add a button.
Any clue on where to add it in the codex?
I realize that Button Snap will not work with WP1.5 right?
Does this not work in WP 2.0.5?
It does not work with WP 2.05 at my blog
Why is this not in the core? H1 tags are a basic building block of the web.