Changeset 4345
- Timestamp:
- 05/10/2011 02:52:31 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-functions.php
r4334 r4345 25 25 } 26 26 27 /** 28 * Populates the BP blogs table with existing blogs. 29 * 30 * @package BuddyPress Blogs 31 * 32 * @global object $bp BuddyPress global settings 33 * @global object $wpdb WordPress database object 34 * @uses get_users() 35 * @uses bp_blogs_record_blog() 36 */ 27 37 function bp_blogs_record_existing_blogs() { 28 38 global $bp, $wpdb; … … 35 45 if ( $blog_ids ) { 36 46 foreach( (array)$blog_ids as $blog_id ) { 37 $users = get_users_of_blog( $blog_id ); 38 47 $users = get_users( array( 'blog_id' => $blog_id ) ); 48 $subscribers = get_users( array( 'blog_id' => $blog_id, 'role' => 'subscriber' ) ); 49 39 50 if ( $users ) { 40 51 foreach ( (array)$users as $user ) { 41 $role = unserialize( $user->meta_value ); 42 43 if ( !isset( $role['subscriber'] ) ) 44 bp_blogs_record_blog( $blog_id, $user->user_id, true ); 52 // Don't record blogs for subscribers 53 if ( !in_array( $user, $subscribers ) ) 54 bp_blogs_record_blog( $blog_id, $user->ID, true ); 45 55 } 46 56 }
Note: See TracChangeset
for help on using the changeset viewer.