Ticket #40489: 40489.diff
File 40489.diff, 2.0 KB (added by , 7 years ago) |
---|
-
src/wp-includes/ms-functions.php
2480 2480 * Plugins can alter this criteria using the {@see 'wp_is_large_network'} filter. 2481 2481 * 2482 2482 * @since 3.3.0 2483 * @param string $using 'sites or 'users'. Default is 'sites'. 2483 * @since 4.8.0 The $network_id parameter has been added. 2484 * 2485 * @param string $using 'sites or 'users'. Default is 'sites'. 2486 * @param int|null $network_id ID of the network. Default is the current network. 2484 2487 * @return bool True if the network meets the criteria for large. False otherwise. 2485 2488 */ 2486 function wp_is_large_network( $using = 'sites' ) { 2489 function wp_is_large_network( $using = 'sites', $network_id = null ) { 2490 $network_id = (int) $network_id; 2491 if ( ! $network_id ) { 2492 $network_id = get_current_network_id(); 2493 } 2494 2487 2495 if ( 'users' == $using ) { 2488 $count = get_user_count( );2496 $count = get_user_count( $network_id ); 2489 2497 /** 2490 2498 * Filters whether the network is considered large. 2491 2499 * 2492 2500 * @since 3.3.0 2501 * @since 4.8.0 The $network_id parameter has been added. 2493 2502 * 2494 2503 * @param bool $is_large_network Whether the network has more than 10000 users or sites. 2495 2504 * @param string $component The component to count. Accepts 'users', or 'sites'. 2496 2505 * @param int $count The count of items for the component. 2506 * @param int $network_id The ID of the network being checked. 2497 2507 */ 2498 return apply_filters( 'wp_is_large_network', $count > 10000, 'users', $count );2508 return apply_filters( 'wp_is_large_network', $count > 10000, 'users', $count, $network_id ); 2499 2509 } 2500 2510 2501 $count = get_blog_count( );2511 $count = get_blog_count( $network_id ); 2502 2512 /** This filter is documented in wp-includes/ms-functions.php */ 2503 return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count );2513 return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count, $network_id ); 2504 2514 } 2505 2515 2506 2516 /**