• hi,
    i’m building a plugin. i hooked a function to be triggered when my plugin is activated (create table and update_option)… it was working before then suddenly after a while it’s not working anymore. i’m using register_activation_hook(__FILE__, array(&$obj, 'activate_my_plugin'))
    it’s not working anymore so i have to call the activate_my_plugin() function in the admin_head hook… (it’s working using the admin_head hook)
    also i have 5 textareas in my plugin’s options page, i need 3 of them converted into tinymce editors. i success fully loaded tinymce using wp_enqueue_script('tiny_mce') function then i used the usual tinyMCE.init() to initialize the textareas but did’nt work. i also tried using tinyMCE.execCommand("mceAddControl", false, "id_of_textarea") but still didn’t work… HOW DO I ADD A TINYMCE EDITOR IN SPECIFIC TEXTAREAS IN MY OPTIONS PAGE?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, about that tinyMCE problem.
    I was just having the same problem.

    I figured out that the initialization function of tinyMCE loaded after my own initialization function (on document load) so I set a small delay to add the controls to the textareas. Something like this:

    jQuery(function(){
      window.setTimeout( function(){
        jQuery("textarea.mceEditor").each(function(i){
            this.id = "mceEditor" + (i + 1);
            tinyMCE.execCommand("mceAddControl", false, this.id);
        });
      }, 100);
    });

    To my surprise this worked. The only problem is that it keeps loading in FF. You can do everything but the spinner keeps on going.

    I did some work on adding TinyMCE to the profile editor:

    https://www.ads-software.com/support/topic/229882

    Perhaps this would be helpful.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘plugin development: plugin activation and tinymce problem’ is closed to new replies.