WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi iam developing a plugin to activated a couple of plugins. i.e: the plugin jetpack has six plugins and all gets activated on a single install,like wise i need to activate a group of plugins from acivating this plugin.

for example consider a plugin called 'site plugin' which has sub folders of other plugins. when i activate 'site plugin' it should show options to activate other plugins in it.

I hope some one could help me.

share|improve this question

migrated from stackoverflow.com Jun 30 '11 at 14:26

This question came from our site for professional and enthusiast programmers.

Are these child plugins developed by third parties or are they all your own code? – scribu Jun 30 '11 at 15:23
up vote 2 down vote accepted

You're main pluggin can use register_activation_hook and use the function you register thru the hook to activate you're necesary pluggins.

Smth along these lines :

    // get already activated plugins
    $plugins = get_option('active_plugins');
    $puginsToActiv = array('Plugin1', 'Plugin2', 'Plugin3');
        $changed = false;
        foreach ($puginsTostActiv as $plugin)
            if (!in_array($plugin, $plugins))
                $changed = true;

        if ( $changed )
// code not tested
share|improve this answer
Or you could use activate_plugin() found in wp-admin/includes/plugin.php – scribu Jun 30 '11 at 15:24
@scribu : yes you could use that too – poelinca Jul 1 '11 at 2:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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