[wp-hackers] Editor button cusotmizations

Elliotte Harold elharo at metalab.unc.edu
Wed Apr 11 21:53:51 GMT 2007


Robin Adrianse wrote:
> Yeah, forking seems like a drastic action. There are many filters and
> actions (along with JavaScript methods) to add/remove buttons.
> 

I'd certainly prefer not to have to fork if I can avoid it.

After tracing through several files, it looks like the relevant code is 
in quicktags.js. The relevant code looks like this:

edButtons[edButtons.length] =
new edButton('ed_ol'
,'ol'
,'<ol>\n'
,'</ol>\n\n'
,'o'
);

It's very weird that this is all done with JavaScript. It's not clear 
why this couldn't be simple HTML.

Anyway, it's obvious in the code how to remove or add or change a 
button. I could very quickly hack this, but then I'd have to maintain my 
changes across upgrades. I'm not sure where I should be looking to do 
this in a plug-in though. Is there a specific action or filter that 
would be appropriate?

Please remember I am talking about the regular editor, *not* the rich 
editor. There seem to be more hooks for this in the rich editor.


-- 
Elliotte Rusty Harold  elharo at metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/


More information about the wp-hackers mailing list