Changeset 53011 for trunk/src/wp-includes/ms-functions.php
- Timestamp:
- 03/29/2022 12:41:00 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r52737 r53011 99 99 return $primary; 100 100 } 101 }102 103 /**104 * The number of active users in your installation.105 *106 * The count is cached and updated twice daily. This is not a live count.107 *108 * @since MU (3.0.0)109 * @since 4.8.0 The `$network_id` parameter has been added.110 *111 * @param int|null $network_id ID of the network. Default is the current network.112 * @return int Number of active users on the network.113 */114 function get_user_count( $network_id = null ) {115 return get_network_option( $network_id, 'user_count' );116 101 } 117 102 … … 2612 2597 * @since 3.7.0 2613 2598 * @since 4.8.0 The `$network_id` parameter has been added. 2614 * 2615 * @global wpdb $wpdb WordPress database abstraction object. 2599 * @since 6.0.0 This function is now a wrapper for wp_update_user_counts(). 2616 2600 * 2617 2601 * @param int|null $network_id ID of the network. Default is the current network. 2618 2602 */ 2619 2603 function wp_update_network_user_counts( $network_id = null ) { 2620 global $wpdb; 2621 2622 $count = $wpdb->get_var( "SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'" ); 2623 update_network_option( $network_id, 'user_count', $count ); 2604 wp_update_user_counts( $network_id ); 2624 2605 } 2625 2606 … … 2755 2736 if ( 'users' === $using ) { 2756 2737 $count = get_user_count( $network_id ); 2738 2739 $is_large_network = wp_is_large_user_count( $network_id ); 2740 2757 2741 /** 2758 2742 * Filters whether the network is considered large. … … 2766 2750 * @param int $network_id The ID of the network being checked. 2767 2751 */ 2768 return apply_filters( 'wp_is_large_network', $ count > 10000, 'users', $count, $network_id );2752 return apply_filters( 'wp_is_large_network', $is_large_network, 'users', $count, $network_id ); 2769 2753 } 2770 2754
Note: See TracChangeset
for help on using the changeset viewer.