enable_live_network_counts

enable_live_network_counts

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('enable_live_network_counts') is found 3 times:

  • /wp-includes/ms-functions.php line 2455
    2451
    2452
    2453
    2454
    2455
    2456
    2457
    2458
    2459
    2460
         *
         * @param bool   $small_network Whether the network is considered small.
         * @param string $context       Context. Either 'users' or 'sites'.
         */
        if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) ) {
            return;
        }
     
        wp_update_network_site_counts( $network_id );
    }
  • /wp-includes/ms-functions.php line 2477
    2473
    2474
    2475
    2476
    2477
    2478
    2479
    2480
    2481
    2482
    function wp_maybe_update_network_user_counts( $network_id = null ) {
        $is_small_network = ! wp_is_large_network( 'users', $network_id );
     
        /** This filter is documented in wp-includes/ms-functions.php */
        if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) {
            return;
        }
     
        wp_update_network_user_counts( $network_id );
    }
  • /wp-includes/user.php line 1421
    1417
    1418
    1419
    1420
    1421
    1422
    1423
    1424
    1425
    1426
        }
     
        $is_small_network = ! wp_is_large_user_count( $network_id );
        /** This filter is documented in wp-includes/ms-functions.php */
        if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) {
            return false;
        }
     
        return wp_update_user_counts( $network_id );
    }