Changeset 12486
- Timestamp:
- 10/30/2019 06:52:45 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/bp-groups/bp-groups-functions.php
r12446 r12486 981 981 // Prime the invitations cache. 982 982 $uncached_invitation_ids = bp_get_non_cached_ids( $invitation_ids, 'bp_groups_invitations_as_memberships' ); 983 984 $uncached_invitations = groups_get_invites( array( 985 'ids' => $uncached_invitation_ids, 986 'invite_sent' => 'all', 987 'type' => 'all' 988 ) ); 989 foreach ( $uncached_invitations as $uncached_invitation ) { 990 // Reshape the result as a membership db entry. 991 $invitation = new StdClass; 992 $invitation->id = $uncached_invitation->id; 993 $invitation->group_id = $uncached_invitation->item_id; 994 $invitation->user_id = $uncached_invitation->user_id; 995 $invitation->inviter_id = $uncached_invitation->inviter_id; 996 $invitation->is_admin = false; 997 $invitation->is_mod = false; 998 $invitation->user_title = ''; 999 $invitation->date_modified = $uncached_invitation->date_modified; 1000 $invitation->comments = $uncached_invitation->content; 1001 $invitation->is_confirmed = false; 1002 $invitation->is_banned = false; 1003 $invitation->invite_sent = $uncached_invitation->invite_sent; 1004 wp_cache_set( $uncached_invitation->id, $invitation, 'bp_groups_invitations_as_memberships' ); 983 if ( $uncached_invitation_ids ) { 984 $uncached_invitations = groups_get_invites( array( 985 'id' => $uncached_invitation_ids, 986 'invite_sent' => 'all', 987 'type' => 'all' 988 ) ); 989 foreach ( $uncached_invitations as $uncached_invitation ) { 990 // Reshape the result as a membership db entry. 991 $invitation = new StdClass; 992 $invitation->id = $uncached_invitation->id; 993 $invitation->group_id = $uncached_invitation->item_id; 994 $invitation->user_id = $uncached_invitation->user_id; 995 $invitation->inviter_id = $uncached_invitation->inviter_id; 996 $invitation->is_admin = false; 997 $invitation->is_mod = false; 998 $invitation->user_title = ''; 999 $invitation->date_modified = $uncached_invitation->date_modified; 1000 $invitation->comments = $uncached_invitation->content; 1001 $invitation->is_confirmed = false; 1002 $invitation->is_banned = false; 1003 $invitation->invite_sent = $uncached_invitation->invite_sent; 1004 wp_cache_set( $uncached_invitation->id, $invitation, 'bp_groups_invitations_as_memberships' ); 1005 } 1005 1006 } 1006 1007 } 1008 1007 } 1009 1008 1010 1009 // Assemble filter array for use in `wp_list_filter()`.
Note: See TracChangeset
for help on using the changeset viewer.