Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions src/Core_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -1559,16 +1559,9 @@ public function update_db( $args, $assoc_args ) {

if ( $network ) {
// Determine the network ID to update.
// get_current_network_id() (available since WP 4.9) reflects the network
// determined from the --url context, enabling per-network updates in
// multinetwork setups. Fall back to SITE_ID_CURRENT_SITE for older WordPress.
if ( function_exists( 'get_current_network_id' ) ) {
$network_id = get_current_network_id();
} elseif ( defined( 'SITE_ID_CURRENT_SITE' ) ) {
$network_id = (int) SITE_ID_CURRENT_SITE;
} else {
$network_id = 1;
}
// get_current_network_id() reflects the network determined from the --url context,
// enabling per-network updates in multinetwork setups.
$network_id = get_current_network_id();

$iterator_args = [
'table' => $wpdb->blogs,
Expand Down