Adding wp_editor inside a thickbox Adding wp_editor inside a thickbox wordpress wordpress

Adding wp_editor inside a thickbox


Funny, that thickbox doesn't provides any callbacks. But as I mentioned on twitter, I would try a $.ajaxSuccess call to solve the ugly js-inject. Just add the following to one of your javascript files:

(function($) {    // gets called for every successful ajax call    $(document).ajaxSuccess( function(evt, request, settings) {        // make sure this call was from your thickbox        if ($('#your-thickbox-selector').length > 0) {            tinymce.execCommand('mceAddControl',true,'postcontent');        }    }); })( jQuery );

UPDATE: The ajaxSuccess method has to be assigned to an element, changed the code