XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/include/xpress_active_plugin.php @ 852

Last change on this file since 852 was 232, checked in by toemon, 15 years ago

external追加に伴うフォルダー構成変更

File size: 755 bytes
Line 
1<?php
2if ( !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.