[buddypress-trac] [BuddyPress Trac] #7078: Groups: Replace `BP_Group_Member` static method DB queries with updated group membership functions

buddypress-trac noreply at wordpress.org
Sat May 21 18:26:43 UTC 2016


#7078: Groups: Replace `BP_Group_Member` static method DB queries with updated
group membership functions
--------------------------------+------------------
 Reporter:  r-a-y               |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  2.6
Component:  Component - Groups  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |
--------------------------------+------------------
Description changed by r-a-y:

Old description:

> Addendum to #6327.
>
> This patch replaces all `BP_Group_Member` static methods relying on DB
> queries with the new group membership cached versions available from
> #6327.
>
> Patch also fixes up `groups_check_user_has_invite()` and
> `groups_check_for_membership_request()` to use the new
> `bp_get_user_groups() function.
>
> This saves up to 6 queries on single group pages.
>
> One thing that this patch changes though is the return value of null
> values in the `BP_Group_Member` static methods.  Failures now return
> integer 0 instead.
>
> Patch passes all existing unit tests.

New description:

 Addendum to #6327.

 This patch replaces ~~all~~ most `BP_Group_Member` static methods relying
 on DB queries with the new group membership cached versions available from
 #6327.

 Patch also fixes up `groups_check_user_has_invite()` and
 `groups_check_for_membership_request()` to use the new
 `bp_get_user_groups() function.

 This saves up to 6 queries on single group pages.

 One thing that this patch changes though is the return value of null
 values in the `BP_Group_Member` static methods.  Failures now return
 integer 0 instead.

 Patch passes all existing unit tests.

--

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7078#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list