diff --git src/wp-includes/ms-functions.php src/wp-includes/ms-functions.php
index 3eb7f67..cfb78f5 100644
|
|
|
2289 | 2289 | * |
2290 | 2290 | * @since 3.7.0 |
2291 | 2291 | * |
2292 | | * @global wpdb $wpdb WordPress database abstraction object. |
| 2292 | * @param int $network_id Optional. Id of the network to calculate the site count for. Defaults to active network id. |
2293 | 2293 | */ |
2294 | | function wp_update_network_site_counts() { |
2295 | | global $wpdb; |
| 2294 | function wp_update_network_site_counts( $network_id = null ) { |
| 2295 | |
| 2296 | $network_id = (int) $network_id; |
| 2297 | if ( ! $network_id ) { |
| 2298 | $network_id = get_current_network_id(); |
| 2299 | } |
2296 | 2300 | |
2297 | 2301 | $count = get_sites( array( |
2298 | | 'network_id' => $wpdb->siteid, |
| 2302 | 'network_id' => $network_id, |
2299 | 2303 | 'spam' => 0, |
2300 | 2304 | 'deleted' => 0, |
2301 | 2305 | 'archived' => 0, |
2302 | 2306 | 'count' => true, |
2303 | 2307 | ) ); |
2304 | 2308 | |
2305 | | update_site_option( 'blog_count', $count ); |
| 2309 | update_network_option( $network_id, 'blog_count', $count ); |
2306 | 2310 | } |
2307 | 2311 | |
2308 | 2312 | /** |