get_current_network_id() - WordPress 函数参考中文文档

返回介绍

get_current_network_id()

发布于 2017-09-10 字数1982 浏览 923 评论 0

get_current_network_id()

Retrieves the current network ID.


描述


返回值

(int) The ID of the current network.


源代码

File: wp-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 );
}

更新日志

Version 描述
4.6.0 Introduced.

相关函数

Uses

  • wp-includes/ms-blogs.php:
    get_network()
  • wp-includes/functions.php:
    get_main_network_id()
  • wp-includes/load.php:
    is_multisite()
  • wp-includes/functions.php:
    absint()

Used By

  • wp-includes/option.php:
    update_network_option()
  • wp-includes/option.php:
    add_network_option()
  • wp-includes/option.php:
    delete_network_option()
  • wp-includes/option.php:
    get_network_option()
  • wp-admin/includes/class-wp-ms-sites-list-table.php:
    WP_MS_Sites_List_Table::prepare_items()
  • wp-includes/functions.php:
    is_main_network()
  • wp-includes/ms-functions.php:
    wp_update_network_site_counts()
  • wp-includes/ms-functions.php:
    wp_is_large_network()
  • wp-includes/ms-functions.php:
    wpmu_signup_blog_notification()
  • wp-includes/class-wp-xmlrpc-server.php:
    wp_xmlrpc_server::wp_getUsersBlogs()
  • Show 5 more used by
    Hide more used by


User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!