Opened 13 years ago
Last modified 16 months ago
#3842 new enhancement
Group and member template functions should check current group/member as well
Reported by: | boonebgorges | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Contributions | Priority: | minor |
Severity: | normal | Version: | |
Component: | Groups | Keywords: | needs-patch 2nd-opinion |
Cc: | dcavins |
Description
Currently we have functions like bp_get_group_name(), which accept a $group object, and falls back on $groups_template->group if no $group is passed. Frustratingly, most of these functions do not work when viewing a specific group. Those functions should fall back on $bp->groups->current_group when possible.
Same thing with members template functions. When possible, fall back on properties of $bp->displayed_user.
Attachments (1)
Change History (6)
This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.
8 years ago
Note: See
TracTickets for help on using
tickets.
I was thinking about these template functions, too, and offer the attached as one concept toward bringing the template and other functions closer together. In it, I've changed
groups_get_current_group()
so that it checks the$groups_template
global first then goes to thebuddypress()
second. The result is that it works in a groups loop or within a group (inside or outside thehas_groups()
loop that builds the group).@boonebgorges: Was a single group built using
bp_has_groups()
when you submitted this ticket, or was that done since (which mostly fixed the original issue)?