Skip to content

Commit 28d8214

Browse files
committed
Multisite: Add $network_id parameter to wp_maybe_update_network_site_counts().
This allows calling the function for a specific network correctly, for example after a site has been created for it or been removed from it. Fixes #40384. See #38699. git-svn-id: https://develop.svn.wordpress.org/trunk@40591 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 1515787 commit 28d8214

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/wp-includes/ms-functions.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2300,9 +2300,10 @@ function wp_update_network_counts( $network_id = null ) {
23002300
* on a network when a site is created or its status is updated.
23012301
*
23022302
* @since 3.7.0
2303+
* @since 4.8.0 The $network_id parameter has been added.
23032304
*/
2304-
function wp_maybe_update_network_site_counts() {
2305-
$is_small_network = ! wp_is_large_network( 'sites' );
2305+
function wp_maybe_update_network_site_counts( $network_id = null ) {
2306+
$is_small_network = ! wp_is_large_network( 'sites', $network_id );
23062307

23072308
/**
23082309
* Filters whether to update network site or user counts when a new site is created.
@@ -2317,7 +2318,7 @@ function wp_maybe_update_network_site_counts() {
23172318
if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) )
23182319
return;
23192320

2320-
wp_update_network_site_counts();
2321+
wp_update_network_site_counts( $network_id );
23212322
}
23222323

23232324
/**

0 commit comments

Comments
 (0)