Support » Plugins » Loading wp_editor through wordpress ajax not working

  • Hi
    I am trying to load wp editor (through wp_editor() function) using wordpress admin ajax inside a jquery tab for my plugin.

    But the editor is not displayed properly. No icons but visual/html tabs and media upload works.

    I see that wp loads some js for tinymce in footer when loaded normally without ajax. But how to do the same when loaded via ajax?


Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Macpraveen,

    I am working on something similar and I noticed that in order for the icons to display properly the editor needs to be passed a unique id when you call it.

    It seems like you might have an answer to a related question I have — I would like to fetch a wp editor on demand using ajax, but all I can seem to do with wp_editor() is echo the editor, not put it into a string to send to my javascript. How are you fetching an editor using ajax?

    This is what isn’t working:

    function addquestionanswerbox() {
    		$boxHTML+= "<h2>Question {($number+1)} :</h2>";
    		$boxHTML+= wp_editor( $question_c , "qaeditorq{($number+1)}", array('textarea_name'=>"qa_question[]") );
    		$boxHTML+= "<h2>Answer{($number+1)} :</h2>";
    		$boxHTML+= wp_editor( $answer_c , "qaeditora{($number+1)}", array('textarea_name'=>"qa_answer[]") );   

    I would love to hear how you did this!


    Sorry, I should have been more specific about the answer to your question:

    wp_editor(“” , “uniqueid”, array(‘textarea_name’=>”textareaname”) );

    should produce a functioning editor with nothing in it.

    Hi guys,

    Sorry to bump this question but I am also looking for the exact same solution. I tried loading the wp_editor via ajax and just get a half arsed textarea instead.

    Anybody else know if there is a way?


    Hi all,

    I’m having problem with loading the_editor via ajax. is there any solution?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Loading wp_editor through wordpress ajax not working’ is closed to new replies.