On this page
get_blog_count( int|null $network_id = null ): int
Gets the number of active sites on the installation.
Description
The count is cached and updated twice daily. This is not a live count.
Parameters
$network_idint|null Optional-
ID of the network. Default is the current network.
Default:
null
Return
int Number of active sites on the network.
Source
File: wp-includes/ms-functions.php. View all references
function get_blog_count( $network_id = null ) {
return get_network_option( $network_id, 'blog_count' );
}
Related
Uses
| Uses | Description |
|---|---|
| get_network_option() wp-includes/option.php | Retrieves a network’s option value based on the option name. |
Used By
| Used By | Description |
|---|---|
| WP_Debug_Data::debug_data() wp-admin/includes/class-wp-debug-data.php | Static function for generating site debug data when required. |
| wp_network_dashboard_right_now() wp-admin/includes/dashboard.php | |
| wp_version_check() wp-includes/update.php | Checks WordPress version against the newest version. |
| wp_is_large_network() wp-includes/ms-functions.php | Determines whether or not we have a large network. |
| get_sitestats() wp-includes/ms-functions.php | Gets the network’s site and user counts. |
Changelog
| Version | Description |
|---|---|
| MU (3.0.0) | MU (3.0.0) |
| 4.8.0 | The $network_id parameter is now being used. |
| 3.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_blog_count