From 6ac2081c9970e60b1ec55113f54e6b6ffedfec50 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 4 May 2026 15:18:22 +0200 Subject: [PATCH 1/2] Unconditionally use `get_current_network_id` The function was actually introduced in WP 4.6 and we now require 4.9 --- src/Core_Command.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/Core_Command.php b/src/Core_Command.php index 4f7dfcf7..f34d2d6a 100644 --- a/src/Core_Command.php +++ b/src/Core_Command.php @@ -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, From 912cab85728fb3bde420d12d813700e28b161eac Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 4 May 2026 15:48:35 +0200 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/Core_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core_Command.php b/src/Core_Command.php index f34d2d6a..8438f664 100644 --- a/src/Core_Command.php +++ b/src/Core_Command.php @@ -1559,7 +1559,7 @@ public function update_db( $args, $assoc_args ) { if ( $network ) { // Determine the network ID to update. - // get_current_network_id reflects the network determined from the --url context + // 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();