Skip to content

Commit f0dc0ea

Browse files
swissspidyCopilot
andauthored
Unconditionally use get_current_network_id (#329)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent d6bafba commit f0dc0ea

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

src/Core_Command.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,16 +1559,9 @@ public function update_db( $args, $assoc_args ) {
15591559

15601560
if ( $network ) {
15611561
// Determine the network ID to update.
1562-
// get_current_network_id() (available since WP 4.9) reflects the network
1563-
// determined from the --url context, enabling per-network updates in
1564-
// multinetwork setups. Fall back to SITE_ID_CURRENT_SITE for older WordPress.
1565-
if ( function_exists( 'get_current_network_id' ) ) {
1566-
$network_id = get_current_network_id();
1567-
} elseif ( defined( 'SITE_ID_CURRENT_SITE' ) ) {
1568-
$network_id = (int) SITE_ID_CURRENT_SITE;
1569-
} else {
1570-
$network_id = 1;
1571-
}
1562+
// get_current_network_id() reflects the network determined from the --url context,
1563+
// enabling per-network updates in multinetwork setups.
1564+
$network_id = get_current_network_id();
15721565

15731566
$iterator_args = [
15741567
'table' => $wpdb->blogs,

0 commit comments

Comments
 (0)