Line | |
---|
1 | <?php
|
---|
2 | if ( !function_exists('xpress_pulugin_activation') ){
|
---|
3 | function xpress_pulugin_activation($activation_plugin = '')
|
---|
4 | {
|
---|
5 | global $wpdb;
|
---|
6 | if (empty($activation_plugin)) return false;
|
---|
7 |
|
---|
8 | $plugins = get_option('active_plugins');
|
---|
9 | $is_active = false;
|
---|
10 | if (!empty($plugins)){
|
---|
11 | foreach($plugins as $plugin){
|
---|
12 | if ($plugin == $activation_plugin) {
|
---|
13 | $is_active = true;
|
---|
14 | break;
|
---|
15 | }
|
---|
16 | }
|
---|
17 | } else {
|
---|
18 | $plugins = array();
|
---|
19 | }
|
---|
20 | if (!$is_active){
|
---|
21 | array_push($plugins, $activation_plugin);
|
---|
22 | update_option('active_plugins', $plugins);
|
---|
23 | include_once(dirname(dirname(__FILE__) ) . '/wp-content/plugins/'.$activation_plugin);
|
---|
24 | do_action('activate_'.$activation_plugin);
|
---|
25 | return true;
|
---|
26 | }
|
---|
27 | return false;
|
---|
28 | }
|
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.