Ticket #5815: 5815.01.patch
File 5815.01.patch, 990 bytes (added by , 10 years ago) |
---|
-
src/bp-blogs/bp-blogs-functions.php
1127 1127 /** 1128 1128 * Get the total number of blogs being tracked by BP for a specific user. 1129 1129 * 1130 * @since BuddyPress (1.2.0) 1131 * 1130 1132 * @param int $user_id ID of the user being queried. Default: on a user page, 1131 1133 * the displayed user. Otherwise, the logged-in user. 1132 1134 * @return int $count Total blog count for the user. 1133 1135 */ 1134 1136 function bp_blogs_total_blogs_for_user( $user_id = 0 ) { 1135 1136 if ( empty( $user_id ) ) 1137 if ( empty( $user_id ) ) { 1137 1138 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id(); 1139 } 1140 1141 // no user ID? do not attempt to look at cache 1142 if ( empty( $user_id ) ) { 1143 return 0; 1144 } 1138 1145 1139 1146 if ( !$count = wp_cache_get( 'bp_total_blogs_for_user_' . $user_id, 'bp' ) ) { 1140 1147 $count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );