=== modified file 'wp-admin/plugins.php'
|
|
|
15 | 15 | @include(ABSPATH . PLUGINDIR . '/' . $plugin); |
16 | 16 | $current[] = $plugin; |
17 | 17 | sort($current); |
18 | | update_option('active_plugins', $current); |
| 18 | $can_activate = true; //flag that can be set to false by the plugin |
| 19 | do_action('before_activate_' . $plugin); |
| 20 | if($can_activate){ //if the plugin says we shouldn't activate, trust it |
| 21 | update_option('active_plugins', $current); |
| 22 | } else { |
| 23 | exit; |
| 24 | } |
19 | 25 | do_action('activate_' . $plugin); |
20 | 26 | } |
21 | 27 | wp_redirect('plugins.php?activate=true'); // overrides the ?error=true one above |