Skip to:

Opened 8 years ago

Closed 8 years ago

#7069 closed defect (bug) (fixed)

$group object should be supplied to bp_get_group_name filter in bp-groups-admin.php

Reported by: garrett-eclipse's profile garrett-eclipse Owned by: boonebgorges's profile boonebgorges
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.5.0
Component: Groups Keywords:


In BP 2.5 the $group object was supplied to the bp_get_group_name filter as outlined in this ticket;

I noticed in bp-groups-admin.php there's a reference to this filter but it's missing the $group object;

$group_name = isset( $group->name ) ? apply_filters( 'bp_get_group_name', $group->name ) : '';

Will need to be updated to also supply the $group object.


Change History (4)

#1 @garrett-eclipse
8 years ago

I found another instance in bp-groups-template.php;

/** This filter is documented in bp-groups/bp-groups-template.php */
$name               = apply_filters( 'bp_get_group_name', $current_group_name );

The apply_filters should include $current_group as the group object in this case as follows;

/** This filter is documented in bp-groups/bp-groups-template.php */
$name               = apply_filters( 'bp_get_group_name', $current_group_name, $current_group );


#2 @boonebgorges
8 years ago

  • Milestone changed from Awaiting Review to 2.6
  • Owner set to boonebgorges
  • Status changed from new to accepted

Thanks for the report. Why are we not using the bp_get_group_name() functions in these locations? That's better than redefining the filter everywhere.

#3 @garrett-eclipse
8 years ago

Agreed, makes more sense to utilize the already filtered function.

#4 @boonebgorges
8 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 10775:

Use bp_get_group_name() instead of redefining filter in various places.

Reduces code duplication, and ensures that changes to filter parameters are
automatically applied to every instance of the filter.

Props garrett-eclipse.
See #6752. Fixes #7069.

Note: See TracTickets for help on using tickets.