On this page
get_current_network_id(): int
Retrieves the current network ID.
Return
int The ID of the current network.
Source
File: wp-includes/load.php. View all references
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 |
|---|---|
| get_network() wp-includes/ms-network.php | Retrieves network data given a network ID or network object. |
| get_main_network_id() wp-includes/functions.php | Gets the main network ID. |
| is_multisite() wp-includes/load.php | If Multisite is enabled. |
| absint() wp-includes/functions.php | Converts a value to non-negative integer. |
Used By
| Used By | Description |
|---|---|
| wp_count_sites() wp-includes/ms-blogs.php | Count number of sites grouped by site status. |
| wp_insert_site() wp-includes/ms-site.php | Inserts a new site into the database. |
| wp_load_press_this() wp-admin/press-this.php | |
| update_network_option() wp-includes/option.php | Updates the value of a network option that was already added. |
| add_network_option() wp-includes/option.php | Adds a new network option. |
| delete_network_option() wp-includes/option.php | Removes a network option by name. |
| get_network_option() wp-includes/option.php | Retrieves a network’s option value based on the option name. |
| validate_another_blog_signup() wp-signup.php | Validates a new site sign-up for an existing user. |
| can_edit_network() wp-admin/includes/ms.php | Whether or not we can edit this network from this page. |
| WP_MS_Sites_List_Table::prepare_items() wp-admin/includes/class-wp-ms-sites-list-table.php | Prepares the list of sites for display. |
| is_main_network() wp-includes/functions.php | Determines whether a network is the main network of the Multisite installation. |
| wp_load_core_site_options() wp-includes/option.php | Loads and caches certain often requested site options if is_multisite() and a persistent cache is not being used. |
| wp_get_sites() wp-includes/ms-deprecated.php | Return an array of sites for a network or networks. |
| wp_update_network_site_counts() wp-includes/ms-functions.php | Updates the network-wide site count. |
| wp_is_large_network() wp-includes/ms-functions.php | Determines whether or not we have a large network. |
| wpmu_activate_signup() wp-includes/ms-functions.php | Activates a signup. |
| wpmu_signup_blog_notification() wp-includes/ms-functions.php | 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. |
| get_admin_users_for_domain() wp-includes/ms-deprecated.php | Get the admin for a domain/path combination. |
| get_active_blog_for_user() wp-includes/ms-functions.php | Gets one of a user’s active blogs. |
| get_blog_list() wp-includes/ms-deprecated.php | Deprecated functionality to retrieve a list of all sites. |
| get_last_updated() wp-includes/ms-blogs.php | Get a list of most recently updated blogs. |
| wp_xmlrpc_server::wp_getUsersBlogs() wp-includes/class-wp-xmlrpc-server.php | Retrieve the blogs of the user. |
Changelog
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_current_network_id