#5427 closed defect (bug) (fixed)
group_id cannot be passed to bp_group_has_invites()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 2.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Groups | Keywords: | |
| Cc: |
Description
It's not possible to pass a $group_id to bp_group_has_invites(). The extract( $r, EXTR_SKIP ) prevents the $group_id parameter from being populated, because the global $group_id is being invoked. In most cases, we don't notice this, because it triggers the if ( ! $group_id ) block (3160), but if you try to call from outside a group page, everything breaks.
The fact that we're passing around a $group_id global is pretty terrible. We need to do it because of how the group_id is set in BP_Groups_Invite_Template::the_invite(). This could use a better workaround, but in the meantime a simple fix is to remove the crummy call to $extract and set the global more intelligently.
https://buddypress.trac.wordpress.org/browser/trunk/bp-groups/bp-groups-template.php#L3149
In 7983: