I need to add TinyMCE to descriptions of images. For it, I'm using this code in my functions.php:
[Code moderated as per the Forum Rules. Please use the pastebin]
On the Edit Media page works fine (wp-admin/media.php?attachment_id=XXX&action=edit). But, I have a problem after opening "Add an Image" modal window, and switching to the "Gallery" tab, from "Edit Post". I can't add a link via TinyMCE editor. Every time I click Add Link from the pop-up modal nothing happens.
I see the problem in gallery.js (gallery.dev.js; wp-admin/js/gallery.js; WordPress loads this JS).
There are 3 lines that do me the trouble:
....
tinymce = w.tinymce;
tinyMCE = w.tinyMCE;
t.editor = tinymce.EditorManager.activeEditor;
....
When I drop "tinymce = w.tinymce;" and "tinyMCE = w.tinyMCE;" and replace "tinymce.EditorManager.activeEditor;" with "w.tinymce.EditorManager.activeEditor" - works fine.
But, I don't want to do a core mod to WordPress
Any help, please.