Make WordPress Core

Changeset 40593


Ignore:
Timestamp:
05/09/2017 04:07:46 PM (8 years ago)
Author:
flixos90
Message:

Multisite: Add $network_id parameter to wp_maybe_update_network_user_counts().

This allows calling the function for a specific network correctly, for example after a user has been created for it or been removed from it.

Fixes #40385. See #38699.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-functions.php

    r40592 r40593  
    23312331 *
    23322332 * @since 3.7.0
    2333  */
    2334 function wp_maybe_update_network_user_counts() {
    2335     $is_small_network = ! wp_is_large_network( 'users' );
     2333 * @since 4.8.0 The $network_id parameter has been added.
     2334 *
     2335 * @param int|null $network_id ID of the network. Default is the current network.
     2336 */
     2337function wp_maybe_update_network_user_counts( $network_id = null ) {
     2338    $is_small_network = ! wp_is_large_network( 'users', $network_id );
    23362339
    23372340    /** This filter is documented in wp-includes/ms-functions.php */
     
    23392342        return;
    23402343
    2341     wp_update_network_user_counts();
     2344    wp_update_network_user_counts( $network_id );
    23422345}
    23432346
Note: See TracChangeset for help on using the changeset viewer.