Changeset 40590 for trunk/src/wp-includes/ms-functions.php
- Timestamp:
- 05/09/2017 03:50:04 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r40589 r40590 2491 2491 * 2492 2492 * @since 3.3.0 2493 * @param string $using 'sites or 'users'. Default is 'sites'. 2493 * @since 4.8.0 The $network_id parameter has been added. 2494 * 2495 * @param string $using 'sites or 'users'. Default is 'sites'. 2496 * @param int|null $network_id ID of the network. Default is the current network. 2494 2497 * @return bool True if the network meets the criteria for large. False otherwise. 2495 2498 */ 2496 function wp_is_large_network( $using = 'sites' ) { 2499 function wp_is_large_network( $using = 'sites', $network_id = null ) { 2500 $network_id = (int) $network_id; 2501 if ( ! $network_id ) { 2502 $network_id = get_current_network_id(); 2503 } 2504 2497 2505 if ( 'users' == $using ) { 2498 $count = get_user_count( );2506 $count = get_user_count( $network_id ); 2499 2507 /** 2500 2508 * Filters whether the network is considered large. 2501 2509 * 2502 2510 * @since 3.3.0 2511 * @since 4.8.0 The $network_id parameter has been added. 2503 2512 * 2504 2513 * @param bool $is_large_network Whether the network has more than 10000 users or sites. 2505 2514 * @param string $component The component to count. Accepts 'users', or 'sites'. 2506 2515 * @param int $count The count of items for the component. 2516 * @param int $network_id The ID of the network being checked. 2507 2517 */ 2508 return apply_filters( 'wp_is_large_network', $count > 10000, 'users', $count );2509 } 2510 2511 $count = get_blog_count( );2518 return apply_filters( 'wp_is_large_network', $count > 10000, 'users', $count, $network_id ); 2519 } 2520 2521 $count = get_blog_count( $network_id ); 2512 2522 /** This filter is documented in wp-includes/ms-functions.php */ 2513 return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count );2523 return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count, $network_id ); 2514 2524 } 2515 2525
Note: See TracChangeset
for help on using the changeset viewer.