get_current_network_id()

最后更新于:2021-11-26 09:03:16

get_current_network_id()

Retrieves the current network ID.

响应

(int) The ID of the current network.

源文件

文件: gc-includes/load.php

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