Deactivate All Plugins feature. fixes #3498
git-svn-id: https://develop.svn.wordpress.org/trunk@5156 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
00915234c2
commit
47ebdc76c7
|
@ -26,6 +26,17 @@ if ( isset($_GET['action']) ) {
|
|||
update_option('active_plugins', $current);
|
||||
do_action('deactivate_' . trim( $_GET['plugin'] ));
|
||||
wp_redirect('plugins.php?deactivate=true');
|
||||
} elseif ($_GET['action'] == 'deactivate-all') {
|
||||
check_admin_referer('deactivate-all');
|
||||
$current = get_option('active_plugins');
|
||||
|
||||
foreach ($current as $plugin) {
|
||||
array_splice($current, array_search($plugin, $current), 1);
|
||||
do_action('deactivate_' . $plugin);
|
||||
}
|
||||
|
||||
update_option('active_plugins', array());
|
||||
wp_redirect('plugins.php?deactivate-all=true');
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
@ -65,6 +76,8 @@ foreach ($check_plugins as $check_plugin) {
|
|||
<div id="message" class="updated fade"><p><?php _e('Plugin <strong>activated</strong>.') ?></p></div>
|
||||
<?php elseif ( isset($_GET['deactivate']) ) : ?>
|
||||
<div id="message" class="updated fade"><p><?php _e('Plugin <strong>deactivated</strong>.') ?></p></div>
|
||||
<?php elseif (isset($_GET['deactivate-all'])) : ?>
|
||||
<div id="message" class="updated fade"><p><?php _e('All plugins <strong>deactivated</strong>.'); ?></p></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrap">
|
||||
|
@ -135,6 +148,10 @@ if (empty($plugins)) {
|
|||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td colspan="5"><a href="<?php echo wp_nonce_url('plugins.php?action=deactivate-all', 'deactivate-all'); ?>"><?php _e('Deactivate All Plugins'); ?></a></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue