|
Last change
on this file since 179 was
179,
checked in by toemon, 17 years ago
|
|
#106 有効になっているプラグインはそのままで、XPressMEプラグインを有効にする処理を実装
誤ってXPressMEプラグインを無効にした場合、ページ読み込み時に有効化を行いリロードさせるようにした。
The activation of the XPressME plugin was executed.
Because the XPressME plugin was invalid.
Please do the rereading seeing on the page.
の表示を行い再読み込みを促すようにした。
|
|
File size:
682 bytes
|
| 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 | foreach($plugins as $plugin){
|
|---|
| 11 | if ($plugin == $activation_plugin) {
|
|---|
| 12 | $is_active = true;
|
|---|
| 13 | break;
|
|---|
| 14 | }
|
|---|
| 15 | }
|
|---|
| 16 | if (!$is_active){
|
|---|
| 17 | array_push($plugins, $activation_plugin);
|
|---|
| 18 | update_option('active_plugins', $plugins);
|
|---|
| 19 | include_once(dirname(dirname(__FILE__) ) . '/wp-content/plugins/'.$activation_plugin);
|
|---|
| 20 | do_action('activate_'.$activation_plugin);
|
|---|
| 21 | return true;
|
|---|
| 22 | }
|
|---|
| 23 | return false;
|
|---|
| 24 | }
|
|---|
| 25 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.