The main problem are the missing scripts. The scripts enqueued in
_WP_Editors::enqueue_scripts() are never printed. The same is true for
So you have to do that in your AJAX callback handler. I have written a demo plugin and put it on GitHub: T5 AJAX Editor.
There is one class named
Ajax_Editor. Its method
render() prints the editor on AJAX requests.
public function render()
if ( ! $this->validator->is_valid( TRUE ) )
die( 'nope' );
wp_editor( $this->data->get(), $this->editor_id, $this->settings );
The exact order is important, an don’t forget the
Note that calling
print_footer_scripts(); will give you more than you expected: some plugins (Query Monitor for example) register their scripts even for AJAX requests, even if they don’t need them there.