[wp-hackers] Re: Adding custom buttons to TinyMCE v3.x
Andrew Ozz
admin at laptoptips.ca
Wed Mar 12 19:38:15 GMT 2008
Alex Rabe wrote:
> During the investigation for the TinyMCE V3 integration, I had this
> terrible problem with the cache file,
> it's cost me 2 hours until I found the reason , that my changes in the
> plugin dialog are not used as long
> as I delete the cache file (not the browser cache).
>
> If I extend in the future my plugin dialog, I want to ensure that the
> cache is rebuild and after your post
> I found the filter as the best option...
In the first TinyMCE compressor, the cache was invalidated only by some
of the settings. That was fixed a few weeks ago, so now it is
invalidated by any change in the init array.
The filter "tiny_mce_version" passes the version number as a string. It
can easily be changed several times by different plugins. All of these
will work:
function my_refresh_mce($ver) {
$ver += 3; // or $ver .= 3; or ++$ver; etc.
return $ver;
}
add_filter('tiny_mce_version', 'my_refresh_mce');
I'll add this to the codex too.
I'm more concerned about how to allow a plugin to use the same
translation method for TinyMCE as WordPress, specifying langs/lang.php
that can be translated with the standard WordPress functions and loading
that instead of langs/[lang].js and langs/[lang]_dlg.js.
There are several ways possible, but all would require some more coding
on the plugin's part. If you are interested in testing this, perhaps
it's better to take it off list, as not many people would be interested.
More information about the wp-hackers
mailing list