get_current_network_id()
Retrieves the current network ID.
Return
(int) The ID of the current network.
Source
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 );
}
Related
Uses
Uses | Description |
---|---|
wp-includes/ms-network.php: get_network() |
Retrieves network data given a network ID or network object. |
wp-includes/load.php: is_multisite() |
If Multisite is enabled. |
wp-includes/functions.php: get_main_network_id() |
Gets the main network ID. |
wp-includes/functions.php: absint() |
Converts a value to non-negative integer. |
Used By
Used By | Description |
---|---|
wp-includes/ms-blogs.php: wp_count_sites() |
Counts number of sites grouped by site status. |
wp-includes/ms-site.php: wp_insert_site() |
Inserts a new site into the database. |
wp-signup.php: validate_another_blog_signup() |
Validates a new site sign-up for an existing user. |
wp-includes/ms-deprecated.php: get_admin_users_for_domain() |
Get the admin for a domain/path combination. |
wp-includes/ms-deprecated.php: wp_get_sites() |
Return an array of sites for a network or networks. |
wp-includes/ms-deprecated.php: get_blog_list() |
Deprecated functionality to retrieve a list of all sites. |
wp-includes/ms-blogs.php: get_last_updated() |
Gets a list of most recently updated blogs. |
wp-includes/class-wp-xmlrpc-server.php: wp_xmlrpc_server::wp_getUsersBlogs() |
Retrieves the blogs of the user. |
wp-includes/option.php: get_network_option() |
Retrieves a network’s option value based on the option name. |
wp-includes/option.php: add_network_option() |
Adds a new network option. |
wp-includes/option.php: delete_network_option() |
Removes a network option by name. |
wp-includes/option.php: update_network_option() |
Updates the value of a network option that was already added. |
wp-includes/option.php: wp_load_core_site_options() |
Loads and caches certain often requested site options if is_multisite() and a persistent cache is not being used. |
wp-includes/ms-functions.php: wp_is_large_network() |
Determines whether or not we have a large network. |
wp-includes/ms-functions.php: wp_update_network_site_counts() |
Updates the network-wide site count. |
wp-includes/ms-functions.php: wpmu_activate_signup() |
Activates a signup. |
wp-includes/ms-functions.php: wpmu_signup_blog_notification() |
Sends a confirmation request email to a user when they sign up for a new site. The new site will not become active until the confirmation link is clicked. |
wp-includes/ms-functions.php: get_active_blog_for_user() |
Gets one of a user’s active blogs. |
wp-includes/functions.php: is_main_network() |
Determines whether a network is the main network of the Multisite installation. |
wp-admin/press-this.php: wp_load_press_this() | |
wp-admin/includes/class-wp-ms-sites-list-table.php: WP_MS_Sites_List_Table::prepare_items() |
Prepares the list of sites for display. |
wp-admin/includes/ms.php: can_edit_network() |
Determines whether or not this network from this page can be edited. |
Changelog
Version | Description |
---|---|
4.6.0 | Introduced. |