Skip to:

Opened 6 years ago

Last modified 14 months ago

#3842 new enhancement

Group and member template functions should check current group/member as well

Reported by: Boone Gorges Owned by:
Milestone: Awaiting Contributions Priority: minor
Severity: normal Version:
Component: Groups Keywords: needs-patch 2nd-opinion
Cc: David Cavins


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)

3842-concept.diff (1.6 KB) - added by David Cavins 16 months ago.
An example change.

Download all attachments as: .zip

Change History (6)

#1 @slaFFik
16 months ago

  • Milestone changed from Future Release to 2.8

#2 @David Cavins
16 months ago

  • Keywords 2nd-opinion added

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 the buddypress() second. The result is that it works in a groups loop or within a group (inside or outside the has_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)?

@David Cavins
16 months ago

An example change.

#3 @David Cavins
16 months ago

  • Cc David Cavins added

#4 @Paul Gibbs
14 months ago

  • Milestone changed from 2.8 to Future Release

This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.

14 months ago

Note: See TracTickets for help on using tickets.