Skip to main content
added 3 characters in body
Source Link
T.Todua
  • 5.9k
  • 9
  • 51
  • 79

Finally, working solution:

add action in wordpress, lets say My_Action_Name (also note, textarea ID My_TextAreaID_22 ):

add_action('wp_ajax_My_Action_Name', function(){
    wp_editor( $_POST['default_text'], 'My_TextAreaID_22',      $settings = array( 'tinymce'=>true, 'textarea_name'=>'name77', 'wpautop' =>false,   'media_buttons' => true ,   'teeny' => false, 'quicktags'=>true, )   );    exit;
});

now, in Dashboard, execute this function (note, using of My_TextAreaID_22 and My_Action_Name):

function start_Ajax_request() { 
    Alert("I have started");
    My_New_Global_Settings =  tinyMCEPreInit.mceInit.content;       // Get default Wordpress SETTINGS  ( I cant confirm, but if you will need to change target ID, then add this line:  My_New_Global_Settings.selector = "My_TextAreaID_22";   )
    jQuery.post(ajaxurl,
        { action: "My_Action_Name",     default_text: "Hello World"}, 
        function(response,status){ 
            Alert("I have Finished");
            tinymce.init(My_New_Global_Settings); 
            tinyMCE.execCommand('mceAddEditor', false, "My_TextAreaID_22"); 
            quicktags({id : "My_TextAreaID_22"});
            // tinyMCE.execCommand( 'mceAddEditor', true, element.id );
        }
    );
                
}   
start_Ajax_request();     // < ---- EXECUTE

Finally, working solution:

add action in wordpress, lets say My_Action_Name (also note, textarea ID My_TextAreaID_22 ):

add_action('wp_ajax_My_Action_Name', function(){
    wp_editor( $_POST['default_text'], 'My_TextAreaID_22',      $settings = array( 'tinymce'=>true, 'textarea_name'=>'name77', 'wpautop' =>false,   'media_buttons' => true ,   'teeny' => false, 'quicktags'=>true, )   );    exit;
});

now, in Dashboard, execute this function (note, using of My_TextAreaID_22 and My_Action_Name):

function start_Ajax_request() { 
    Alert("I have started");
    My_New_Global_Settings =  tinyMCEPreInit.mceInit.content;       // Get default Wordpress SETTINGS  ( I cant confirm, but if you will need to change target ID, then add this line:  My_New_Global_Settings.selector = "My_TextAreaID_22";   )
    jQuery.post(ajaxurl,
        { action: "My_Action_Name",     default_text: "Hello World"}, 
        function(response,status){ 
            Alert("I have Finished");
            tinymce.init(My_New_Global_Settings); 
            tinyMCE.execCommand('mceAddEditor', false, "My_TextAreaID_22"); 
            quicktags({id : "My_TextAreaID_22"});
        }
    );
                
}   
start_Ajax_request();     // < ---- EXECUTE

Finally, working solution:

add action in wordpress, lets say My_Action_Name (also note, textarea ID My_TextAreaID_22 ):

add_action('wp_ajax_My_Action_Name', function(){
    wp_editor( $_POST['default_text'], 'My_TextAreaID_22',      $settings = array( 'tinymce'=>true, 'textarea_name'=>'name77', 'wpautop' =>false,   'media_buttons' => true ,   'teeny' => false, 'quicktags'=>true, )   );    exit;
});

now, in Dashboard, execute this function (note, using of My_TextAreaID_22 and My_Action_Name):

function start_Ajax_request() { 
    My_New_Global_Settings =  tinyMCEPreInit.mceInit.content;       // Get default Wordpress SETTINGS  ( I cant confirm, but if you will need to change target ID, then add this line:  My_New_Global_Settings.selector = "My_TextAreaID_22";   )
    jQuery.post(ajaxurl,
        { action: "My_Action_Name",     default_text: "Hello World"}, 
        function(response,status){ 
            tinymce.init(My_New_Global_Settings); 
            tinyMCE.execCommand('mceAddEditor', false, "My_TextAreaID_22"); 
            quicktags({id : "My_TextAreaID_22"});
            // tinyMCE.execCommand( 'mceAddEditor', true, element.id );
        }
    );
                
}   
start_Ajax_request();     // < ---- EXECUTE
deleted 23 characters in body
Source Link
T.Todua
  • 5.9k
  • 9
  • 51
  • 79

Finally, working solution:

add action in wordpress, lets say My_Action_Name (also note, textarea ID My_TextAreaID_22 ):

add_action('wp_ajax_My_Action_Name', function(){
    wp_editor( "default contenttttttt"$_POST['default_text'], 'My_TextAreaID_22',      $settings = array( 'tinymce'=>true, 'textarea_name'=>'name77', 'wpautop' =>false,   'media_buttons' => true ,   'teeny' => false, 'quicktags'=>true, )   );    exit;
});

now, in Dashboard, execute this function (note, using of My_TextAreaID_22 and My_Action_Name):

function start_Ajax_request() { 
    Alert("I have started");
    My_New_Global_Settings =  tinyMCEPreInit.mceInit.content;       // Get default Wordpress SETTINGS  ( I cant confirm, but if you will need to change target ID, then add this line:  My_New_Global_Settings.selector = "My_TextAreaID_22";   )
    jQuery.post(ajaxurl,
        { action: "My_Action_Name",     other_parameter_99default_text: "blabla","Hello World"}, 
        function(response,status){ 
            Alert("I have Finished");
            tinymce.init(My_New_Global_Settings); 
            tinyMCE.execCommand('mceAddEditor', false, "My_TextAreaID_22"); 
            quicktags({id : "My_TextAreaID_22"});
        }
    );
                
}   
start_Ajax_request();     // < ---- EXECUTE

Finally, working solution:

add action in wordpress, lets say My_Action_Name (also note, textarea ID My_TextAreaID_22 ):

add_action('wp_ajax_My_Action_Name', function(){
    wp_editor( "default contenttttttt", 'My_TextAreaID_22',     $settings = array( 'tinymce'=>true, 'textarea_name'=>'name77', 'wpautop' =>false,   'media_buttons' => true ,   'teeny' => false, 'quicktags'=>true, )   );    exit;
});

now, in Dashboard, execute this function (note, using of My_TextAreaID_22 and My_Action_Name):

function start_Ajax_request() { 
    Alert("I have started");
    My_New_Global_Settings =  tinyMCEPreInit.mceInit.content;       // Get default Wordpress SETTINGS  ( I cant confirm, but if you will need to change target ID, then add this line:  My_New_Global_Settings.selector = "My_TextAreaID_22";   )
    jQuery.post(ajaxurl,
        { action: "My_Action_Name",     other_parameter_99: "blabla", },
        function(response,status){ 
            Alert("I have Finished");
            tinymce.init(My_New_Global_Settings); 
            tinyMCE.execCommand('mceAddEditor', false, "My_TextAreaID_22"); 
            quicktags({id : "My_TextAreaID_22"});
        }
    );
                
}   
start_Ajax_request();     // < ---- EXECUTE

Finally, working solution:

add action in wordpress, lets say My_Action_Name (also note, textarea ID My_TextAreaID_22 ):

add_action('wp_ajax_My_Action_Name', function(){
    wp_editor( $_POST['default_text'], 'My_TextAreaID_22',      $settings = array( 'tinymce'=>true, 'textarea_name'=>'name77', 'wpautop' =>false,   'media_buttons' => true ,   'teeny' => false, 'quicktags'=>true, )   );    exit;
});

now, in Dashboard, execute this function (note, using of My_TextAreaID_22 and My_Action_Name):

function start_Ajax_request() { 
    Alert("I have started");
    My_New_Global_Settings =  tinyMCEPreInit.mceInit.content;       // Get default Wordpress SETTINGS  ( I cant confirm, but if you will need to change target ID, then add this line:  My_New_Global_Settings.selector = "My_TextAreaID_22";   )
    jQuery.post(ajaxurl,
        { action: "My_Action_Name",     default_text: "Hello World"}, 
        function(response,status){ 
            Alert("I have Finished");
            tinymce.init(My_New_Global_Settings); 
            tinyMCE.execCommand('mceAddEditor', false, "My_TextAreaID_22"); 
            quicktags({id : "My_TextAreaID_22"});
        }
    );
                
}   
start_Ajax_request();     // < ---- EXECUTE
deleted 23 characters in body
Source Link
T.Todua
  • 5.9k
  • 9
  • 51
  • 79

Finally, working solution:

  1. add action in wordpress, lets say My_Action_Name:

    add_action('wp_ajax_My_Action_Name', 'my_function999', 1);
    function my_function999(){ wp_editor( "default contenttttttt", 'My_TextAreaID_22', $settings = array( 'tinymce'=>true, textarea_name'=>'name77', 'wpautop' =>false, 'media_buttons' => true , 'teeny' => false, 'quicktags'=>true, ) ); exit; }

p.s.add action in wordpress, lets say My_Action_Name (also note that, textarea ID is My_TextAreaID_22; ):

  1. now, in Dashboard, execute this function (note, using the ID My_TextAreaID_22 and the My_Action_Name):

    function start_Ajax_request() { Alert("I have started"); My_New_Global_Settings = tinyMCEPreInit.mceInit.content; // Get default Wordpress SETTINGS ( I cant confirm, but if you will need to change target ID, then add this line: My_New_Global_Settings.selector = "My_TextAreaID_22"; ) jQuery.post(ajaxurl, { action: "My_Action_Name", other_parameter_99: "blabla", }, function(response,status){ Alert("I have Finished"); tinymce.init(My_New_Global_Settings); tinyMCE.execCommand('mceAddEditor', false, "My_TextAreaID_22"); quicktags({id : "My_TextAreaID_22"}); } );

    }
    start_Ajax_request(); // < ---- EXECUTE

add_action('wp_ajax_My_Action_Name', function(){
    wp_editor( "default contenttttttt", 'My_TextAreaID_22',     $settings = array( 'tinymce'=>true, 'textarea_name'=>'name77', 'wpautop' =>false,   'media_buttons' => true ,   'teeny' => false, 'quicktags'=>true, )   );    exit;
});

now, in Dashboard, execute this function (note, using of My_TextAreaID_22 and My_Action_Name):

function start_Ajax_request() { 
    Alert("I have started");
    My_New_Global_Settings =  tinyMCEPreInit.mceInit.content;       // Get default Wordpress SETTINGS  ( I cant confirm, but if you will need to change target ID, then add this line:  My_New_Global_Settings.selector = "My_TextAreaID_22";   )
    jQuery.post(ajaxurl,
        { action: "My_Action_Name",     other_parameter_99: "blabla", },
        function(response,status){ 
            Alert("I have Finished");
            tinymce.init(My_New_Global_Settings); 
            tinyMCE.execCommand('mceAddEditor', false, "My_TextAreaID_22"); 
            quicktags({id : "My_TextAreaID_22"});
        }
    );
                
}   
start_Ajax_request();     // < ---- EXECUTE

Finally, working solution:

  1. add action in wordpress, lets say My_Action_Name:

    add_action('wp_ajax_My_Action_Name', 'my_function999', 1);
    function my_function999(){ wp_editor( "default contenttttttt", 'My_TextAreaID_22', $settings = array( 'tinymce'=>true, textarea_name'=>'name77', 'wpautop' =>false, 'media_buttons' => true , 'teeny' => false, 'quicktags'=>true, ) ); exit; }

p.s. note that textarea ID is My_TextAreaID_22;

  1. now, in Dashboard, execute this function (note, using the ID My_TextAreaID_22 and the My_Action_Name):

    function start_Ajax_request() { Alert("I have started"); My_New_Global_Settings = tinyMCEPreInit.mceInit.content; // Get default Wordpress SETTINGS ( I cant confirm, but if you will need to change target ID, then add this line: My_New_Global_Settings.selector = "My_TextAreaID_22"; ) jQuery.post(ajaxurl, { action: "My_Action_Name", other_parameter_99: "blabla", }, function(response,status){ Alert("I have Finished"); tinymce.init(My_New_Global_Settings); tinyMCE.execCommand('mceAddEditor', false, "My_TextAreaID_22"); quicktags({id : "My_TextAreaID_22"}); } );

    }
    start_Ajax_request(); // < ---- EXECUTE

Finally, working solution:

add action in wordpress, lets say My_Action_Name (also note, textarea ID My_TextAreaID_22 ):

add_action('wp_ajax_My_Action_Name', function(){
    wp_editor( "default contenttttttt", 'My_TextAreaID_22',     $settings = array( 'tinymce'=>true, 'textarea_name'=>'name77', 'wpautop' =>false,   'media_buttons' => true ,   'teeny' => false, 'quicktags'=>true, )   );    exit;
});

now, in Dashboard, execute this function (note, using of My_TextAreaID_22 and My_Action_Name):

function start_Ajax_request() { 
    Alert("I have started");
    My_New_Global_Settings =  tinyMCEPreInit.mceInit.content;       // Get default Wordpress SETTINGS  ( I cant confirm, but if you will need to change target ID, then add this line:  My_New_Global_Settings.selector = "My_TextAreaID_22";   )
    jQuery.post(ajaxurl,
        { action: "My_Action_Name",     other_parameter_99: "blabla", },
        function(response,status){ 
            Alert("I have Finished");
            tinymce.init(My_New_Global_Settings); 
            tinyMCE.execCommand('mceAddEditor', false, "My_TextAreaID_22"); 
            quicktags({id : "My_TextAreaID_22"});
        }
    );
                
}   
start_Ajax_request();     // < ---- EXECUTE
added 266 characters in body
Source Link
T.Todua
  • 5.9k
  • 9
  • 51
  • 79
Loading
Source Link
T.Todua
  • 5.9k
  • 9
  • 51
  • 79
Loading