Changeset 6542 for trunk/src/includes/core/abstraction.php
- Timestamp:
- 06/14/2017 02:14:39 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/abstraction.php
r6438 r6542 169 169 function bbp_is_large_install() { 170 170 171 // Default to false 172 $retval = false; 171 // Multisite has a function specifically for this 172 $retval = function_exists( 'wp_is_large_network' ) 173 ? wp_is_large_network( 'users' ) 174 : ( bbp_get_total_users() > 10000 ); 173 175 174 // Multisite has a function specifically for this 175 if ( function_exists( 'wp_is_large_network' ) ) { 176 $retval = wp_is_large_network( 'users' ); 177 } else { 178 $bbp_db = bbp_db(); 179 $count = $bbp_db->get_var( "SELECT COUNT(ID) as c FROM {$bbp_db->users} WHERE user_status = '0'" ); 180 $retval = apply_filters( 'wp_is_large_network', ( $count > 10000 ), 'users', $count ); 181 } 176 // Filter & return 177 return (bool) apply_filters( 'bbp_is_large_install', $retval ); 178 } 182 179 183 return (bool) $retval; 180 /** 181 * Get the total number of users on the forums 182 * 183 * @since 2.0.0 bbPress (r2769) 184 * 185 * @uses apply_filters() Calls 'bbp_get_total_users' with number of users 186 * @return int Total number of users 187 */ 188 function bbp_get_total_users() { 189 $bbp_db = bbp_db(); 190 $count = $bbp_db->get_var( "SELECT COUNT(ID) as c FROM {$bbp_db->users} WHERE user_status = '0'" ); 191 192 // Filter & return 193 return (int) apply_filters( 'bbp_get_total_users', (int) $count ); 184 194 }
Note: See TracChangeset
for help on using the changeset viewer.