get_current_network_id() – Retrieves the current network ID.

You appear to be a bot. Output may be restricted

Description

Retrieves the current network ID.

Usage

$int = get_current_network_id();

Parameters

Returns

int The ID of the current network.

Source

File name: wordpress/wp-includes/load.php
Lines:

1 to 13 of 13
function get_current_network_id() {
  if ( ! is_multisite() ) {
    return 1;
  }

  $current_network = get_network();

  if ( ! isset( $current_network->id ) ) {
    return get_main_network_id();
  }

  return absint( $current_network->id );
}
 

 View on GitHub View on Trac