你是主要的插件register_activation_hook 并使用通过挂钩注册的功能来激活所需的插件。
Smth沿线:
// get already activated plugins
$plugins = get_option(\'active_plugins\');
$puginsToActiv = array(\'Plugin1\', \'Plugin2\', \'Plugin3\');
if($plugins)
{
$changed = false;
foreach ($puginsTostActiv as $plugin)
{
if (!in_array($plugin, $plugins))
{
$changed = true;
array_push($plugins,$plugin);
}
}
if ( $changed )
update_option(\'active_plugins\',$plugins);
}
// code not tested