Changeset 8935 for trunk/src/bp-blogs/bp-blogs-functions.php
- Timestamp:
- 08/17/2014 06:11:43 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-functions.php
r8929 r8935 1137 1137 * Get the total number of blogs being tracked by BP for a specific user. 1138 1138 * 1139 * @since BuddyPress (1.2.0) 1140 * 1139 1141 * @param int $user_id ID of the user being queried. Default: on a user page, 1140 1142 * the displayed user. Otherwise, the logged-in user. … … 1142 1144 */ 1143 1145 function bp_blogs_total_blogs_for_user( $user_id = 0 ) { 1144 1145 if ( empty( $user_id ) ) 1146 if ( empty( $user_id ) ) { 1146 1147 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id(); 1147 1148 if ( !$count = wp_cache_get( 'bp_total_blogs_for_user_' . $user_id, 'bp' ) ) { 1148 } 1149 1150 // no user ID? do not attempt to look at cache 1151 if ( empty( $user_id ) ) { 1152 return 0; 1153 } 1154 1155 $count = wp_cache_get( 'bp_total_blogs_for_user_' . $user_id, 'bp' ); 1156 if ( false === $count ) { 1149 1157 $count = BP_Blogs_Blog::total_blog_count_for_user( $user_id ); 1150 1158 wp_cache_set( 'bp_total_blogs_for_user_' . $user_id, $count, 'bp' );
Note: See TracChangeset
for help on using the changeset viewer.