Skip to content

Commit

Permalink
Fixes wp-cli#312.
Browse files Browse the repository at this point in the history
When uninstalling a network activated plugin, the network tag is now added to correctly deactivate the plugin before removal.
  • Loading branch information
NielsdeBlaauw committed Jun 2, 2022
1 parent 68f1fcf commit 89ee56a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Plugin_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,11 @@ public function uninstall( $args, $assoc_args = array() ) {
if ( Utils\get_flag_value( $assoc_args, 'deactivate' ) ) {
WP_CLI::log( "Deactivating '{$plugin->name}'..." );
$this->chained_command = true;
$this->deactivate( array( $plugin->name ) );
$args = [];
if ( is_plugin_active_for_network( $plugin->file ) ) {
$args['network'] = true;
}
$this->deactivate( array( $plugin->name ), $args );
$this->chained_command = false;
}

Expand Down

0 comments on commit 89ee56a

Please sign in to comment.