Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,13 @@
$network_admin_id = get_current_user_id();
}

$clone_network = $assoc_args['clone_network'];
$options_to_clone = false;
$clone_network = $assoc_args['clone_network'];
if ( empty( $clone_network ) ) {
$clone_network = get_current_site()->id;
}

if ( ! empty( $clone_network ) && ! get_network( $clone_network ) ) {
$network_exists = get_network( $clone_network );
if ( empty( $network_exists ) ) {
WP_CLI::error( sprintf( "Clone network %s doesn't exist.", $clone_network ) );
}

Expand All @@ -98,7 +101,7 @@
'user_id' => get_current_user_id(),
'network_admin_id' => $network_admin_id,
'clone_network' => $clone_network,
'options_to_clone' => $options_to_clone,

Check failure on line 104 in wp-multi-network/includes/classes/class-wp-ms-network-command.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Undefined variable: $options_to_clone
)
);

Expand Down
Loading