Skip to content
Snippets Groups Projects
Commit 1380b817 authored by lucha's avatar lucha
Browse files

added command to uninstall plugin

parent 96ff9129
Branches
No related tags found
No related merge requests found
......@@ -81,6 +81,9 @@ Known commands:
rename-plugins BLOG
Disables old plugins and enables new ones, when there has been a change in names.
uninstall-plugin PLUGIN BLOG
Runs unistall action for PLUGIN.
<?php
exit(1);
}
......@@ -539,6 +542,31 @@ function do_rename_plugins($args){
}
}
function do_rename_plugins($args){
include_once(NOBLOGS_ROOT . '/wp-admin/includes/plugin.php');
$plugin = array_shift($args);
if (!$plugin) {
echo "Not enough arguments\n";
help();
}
foreach ($args as $arg) {
$blog = noblogs_get_blog($arg);
if (!$blog) {
echo "{$arg}: blog not found.\n";
continue;
}
switch_to_blog($blog->blog_id);
$plugin_dir = NOBLOGS_ROOT . '/wp-content/plugins/';
if (is_plugin_active( $plugin )){
deactivate_plugins($plugin_dir . $plugin, false, false);
}
restore_current_blog();
}
}
// Command-line parsing.
$cmd = $argv[1];
if (!$cmd) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment