Ticket #1699: get_users.patch
File get_users.patch, 1.1 KB (added by , 15 years ago) |
---|
-
bp-core-classes.php
180 180 $sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 181 181 182 182 /* Get paginated results */ 183 $paged_users = $wpdb->get_results( join( ' ', (array)$sql ) ); 183 $paged_users_sql = apply_filters( 'bp_core_get_users_sql', join( ' ', (array)$sql ) ); 184 $paged_users = $wpdb->get_results( $paged_users_sql ); 184 185 185 186 /* Re-jig the SQL so we can get the total user count */ 186 187 unset( $sql['select_main'] ); … … 200 201 array_unshift( $sql, "SELECT COUNT(DISTINCT u.ID)" ); 201 202 202 203 /* Get total user results */ 203 $total_users = $wpdb->get_var( join( ' ', (array)$sql ) ); 204 $total_users_sql = apply_filters( 'bp_core_get_users_total_sql', join( ' ', (array)$sql ) ); 205 $total_users = $wpdb->get_var( $total_users_sql ); 204 206 205 207 /*** 206 208 * Lets fetch some other useful data in a separate queries, this will be faster than querying the data for every user in a list.