Title: plugin development: plugin activation and tinymce problem
Last modified: August 19, 2016

---

# plugin development: plugin activation and tinymce problem

 *  [sandyandi](https://wordpress.org/support/users/sandyandi/)
 * (@sandyandi)
 * [18 years ago](https://wordpress.org/support/topic/plugin-development-plugin-activation-and-tinymce-problem/)
 * 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)

 *  [Aries-Belgium](https://wordpress.org/support/users/aries-belgium/)
 * (@aries-belgium)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/plugin-development-plugin-activation-and-tinymce-problem/#post-767324)
 * 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.
 *  [alexleonard](https://wordpress.org/support/users/alexleonard/)
 * (@alexleonard)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-development-plugin-activation-and-tinymce-problem/#post-767349)
 * I did some work on adding TinyMCE to the profile editor:
 * [http://wordpress.org/support/topic/229882](http://wordpress.org/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.

## Tags

 * [register_activation_hook](https://wordpress.org/support/topic-tag/register_activation_hook/)
 * [tiny-mce](https://wordpress.org/support/topic-tag/tiny-mce/)

 * 2 replies
 * 3 participants
 * Last reply from: [alexleonard](https://wordpress.org/support/users/alexleonard/)
 * Last activity: [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-development-plugin-activation-and-tinymce-problem/#post-767349)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
