[wp-hackers] TinyMCE plugins outside TinyMCE's plugin directory

Viper007Bond viper at viper007bond.com
Thu Nov 30 12:03:47 GMT 2006


So I've spent the better part of last night and early this morning working
on this, so at this point I may be well out of my mind. Forgive me if I make
a stupid mistake.

Since ButtonSnap no longer works with the new version of TinyMCE that's in
WP 2.1, I've been adding buttons via TinyMCE plugins (external +
tinymce_before_init + tinyMCE.loadPlugin). However, TinyMCE apparently is
hard coded to look in it's own directory for language files resulting in
funny titles for the buttons (untranslated strings).

JS being clientside, I figured I'd just trick TinyMCE into thinking I had a
real, internal plugin in it's folder via a rewrite. I'd call
/wp-includes/js/tinymce/plugins/myplugin/, but it'd actually reside in
/wp-content/plugins/myplugin/tinymce/ or whatever.

I got the rewrite working just fine via the internal PHP class (if you
access the URL of where it should be, it shows up as if it was really
there), however it seems the TinyMCE gzip script is making me fail. It
actually reads the files and compresses them or whatnot. And since my plugin
isn't really there, it doesn't read/compress/output it and so TinyMCE never
sees it. Bah.

Simply put, does anyone have any ideas? Going back to external plugins isn't
the end of the world, but it'd be nice if I could pull this or something
similar off. Perhaps some hooks or filters in the gzip script?

I also was also hoping to use this so I could make a dynamic
editor_plugin.js (like editor_plugin.php and rewrite to it) because I have
multiple buttons that I need to individually be able to turn on and off.
However, I guess I can just show them all and then hide buttons via CSS.
Right now I just have an external plugin for each and every button (what a
pain!).

[/ramblings of a tired madman]

-- 
Viper007Bond | http://www.viper007bond.com/


More information about the wp-hackers mailing list