get_current_network_id

函数


get_current_network_id ( No parameters )
返回值
  • (int) The ID of the current network.
定义位置
  • wp-includes/load.php
    , line 1297
引入
4.6.0
弃用

Retrieves the current network ID.

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 );
}