Skip to:
Content

BuddyPress.org

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's profile 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)

3842-concept.diff (1.6 KB) - added by dcavins 8 years ago.
An example change.

Download all attachments as: .zip

Change History (6)

#1 @slaFFik
8 years ago

  • Milestone changed from Future Release to 2.8

#2 @dcavins
8 years 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)?

@dcavins
8 years ago

An example change.

#3 @dcavins
8 years ago

  • Cc dcavins added

#4 @DJPaul
8 years ago

  • Milestone changed from 2.8 to Future Release

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


8 years ago

Note: See TracTickets for help on using tickets.