Changeset 3910
- Timestamp:
- 05/21/2012 07:50:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-user-functions.php
r3900 r3910 1054 1054 * 1055 1055 * @since bbPress (r2769) 1056 *1057 1056 * @uses wp_cache_get() Check if query is in cache 1058 * @uses wpdb::get_var() To execute our query and get the var back1057 * @uses get_users() To execute our query and get the var back 1059 1058 * @uses wp_cache_set() Set the query in the cache 1060 1059 * @uses apply_filters() Calls 'bbp_get_total_users' with number of users … … 1062 1061 */ 1063 1062 function bbp_get_total_users() { 1064 global $wpdb;1065 1063 1066 1064 $bbp_total_users = wp_cache_get( 'bbp_total_users', 'bbpress' ); … … 1068 1066 return $bbp_total_users; 1069 1067 1070 $bbp_total_users = $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->users} USE INDEX (PRIMARY);");1068 $bbp_total_users = count( get_users() ); 1071 1069 1072 1070 wp_cache_set( 'bbp_total_users', $bbp_total_users, 'bbpress' ); 1073 1071 1074 return apply_filters( 'bbp_get_total_users', (int) $bbp_total_users );1072 return (int) apply_filters( 'bbp_get_total_users', (int) $bbp_total_users ); 1075 1073 } 1076 1074
Note: See TracChangeset
for help on using the changeset viewer.