wpseek.com
WordPress开发者和主题制作者的搜索引擎



get_current_network_id › WordPress Function

Since4.6.0
已弃用n/a
get_current_network_id ( 没有参数 )
返回:
  • (int) The ID of the current network.
定义在:
文档:

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