So I have been spending hours trying to figure out how to make the wp_editor() work on an ajax generated content. I bumped into this post: Load tinyMCE / wp_editor() via AJAX and tried the solution of Mike Allen. His solution almost solves my problem but then there is a problem with my Text tab, I don't see any button: screencast.com/t/Emd2Da3UyThO My Visual tab on the other hand works fine: screencast.com/t/JGWf4ivZfaGb

Inspected my Text tab, I can see that quicktags aren't there: screencast.com/t/qyvwWDnuEPnb But by checking on my window's QTags instances: screencast.com/t/UAzIaZ7XOc5 The description instance (which is not ajax generated content) has the theButtons attribute, while the tabdescription35 (ajax generated) doesn't have one.

  • you're talking about creating wp editor instances in markup that was returned via AJAX calls?
    – Tom J Nowell
    Jan 31, 2014 at 15:02

1 Answer 1


I'm not good with English, but the answer is that the editor class calls the scripts needed in the admin footer (wp-includes/class-wp-editor.php line 160) :

add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js'), 50 );
add_action( 'admin_footer', array( __CLASS__, 'enqueue_scripts'), 1 );

So when you call the wp_editor function in your ajax, the scripts aren't printed with it, so you need to call them in your ajax with :

wp_editor('coool', 'editor_id');
do_action('admin_footer', '');

This definitely works but it may not work as you want because you call all the wp admin footer so the perfect solution is to call only the scripts needed and this may take some time, I'll post the code as soon as possible, but try the code above I think it gives you an idea about what I talking about.

Not the answer you're looking for? Browse other questions tagged or ask your own question.