I have a tinyMCE plugin (for the post/page editor) that I am loading from my WordPress plugin that needs to have several external javascript files loaded in order for my tinyMCE plugin to work.
In WordPress 3.3.1 I can just register and enqueue the scripts from the mce_external_plugins filter but any WordPress version below that doesn’t load the scripts.
Anybody have experience in this?
The method that I found to work with my problem is by hooking to
after_wp_tiny_mceand then in the callback, callingwp_print_scriptsdirectly. It still handles all the dependencies of the scripts.Also, because
wp_localize_scriptwon’t work with this method due to the scripts not being enqueued, I am echoing my objects directly above my calls towp_print_scriptslike this:EDIT :
This fix will only work in WordPress >= 3.2