Ticket #6012: 6012.01.patch
File 6012.01.patch, 2.1 KB (added by , 10 years ago) |
---|
-
src/bp-blogs/bp-blogs-functions.php
1210 1210 * @return int $count Total blog count. 1211 1211 */ 1212 1212 function bp_blogs_total_blogs() { 1213 if ( !$count = wp_cache_get( 'bp_total_blogs', 'bp' ) ) { 1213 $count = wp_cache_get( 'bp_total_blogs', 'bp' ); 1214 1215 if ( false === $count ) { 1214 1216 $blogs = BP_Blogs_Blog::get_all(); 1215 1217 $count = $blogs['total']; 1216 1218 wp_cache_set( 'bp_total_blogs', $count, 'bp' ); -
src/bp-groups/bp-groups-functions.php
633 633 * @return int 634 634 */ 635 635 function groups_get_total_group_count() { 636 if ( !$count = wp_cache_get( 'bp_total_group_count', 'bp' ) ) { 636 $count = wp_cache_get( 'bp_total_group_count', 'bp' ); 637 638 if ( false === $count ) { 637 639 $count = BP_Groups_Group::get_total_group_count(); 638 640 wp_cache_set( 'bp_total_group_count', $count, 'bp' ); 639 641 } … … 673 675 if ( empty( $user_id ) ) 674 676 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id(); 675 677 676 if ( !$count = wp_cache_get( 'bp_total_groups_for_user_' . $user_id, 'bp' ) ) { 678 $count = wp_cache_get( 'bp_total_groups_for_user_' . $user_id, 'bp' ); 679 680 if ( false === $count ) { 677 681 $count = BP_Groups_Member::total_group_count( $user_id ); 678 682 wp_cache_set( 'bp_total_groups_for_user_' . $user_id, $count, 'bp' ); 679 683 } -
src/bp-members/bp-members-functions.php
597 597 function bp_core_get_total_member_count() { 598 598 global $wpdb; 599 599 600 if ( !$count = wp_cache_get( 'bp_total_member_count', 'bp' ) ) { 600 $count = wp_cache_get( 'bp_total_member_count', 'bp' ); 601 602 if ( false === $count ) { 601 603 $status_sql = bp_core_get_status_sql(); 602 604 $count = $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->users} WHERE {$status_sql}" ); 603 605 wp_cache_set( 'bp_total_member_count', $count, 'bp' );