Skip to content

Commit

Permalink
Self activate on new networks by default
Browse files Browse the repository at this point in the history
  • Loading branch information
christianwach committed Sep 17, 2021
1 parent ba57ffe commit b501a92
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions wp-multi-network/includes/classes/class-wp-ms-network-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@ public function create( $args, $assoc_args ) {
WP_CLI::error( $network_id );
}

// Success!
if ( ! empty( $network_id ) && ! is_wp_error( $network_id ) ) {

// Self-activate on new network.
update_network_option(
$network_id,
'active_sitewide_plugins',
array(
'wp-multi-network/wpmn-loader.php' => time(),
)
);

}

WP_CLI::success( sprintf( 'Created network %d.', $network_id ) );
}

Expand Down

0 comments on commit b501a92

Please sign in to comment.