Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/17/2016 08:34:39 PM (10 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-template.php

    r10767 r10775  
    58555855         */
    58565856        function bp_get_current_group_name() {
    5857                 $current_group      = groups_get_current_group();
    5858                 $current_group_name = isset( $current_group->name ) ? $current_group->name : '';
    5859 
    5860                 /** This filter is documented in bp-groups/bp-groups-template.php */
    5861                 $name               = apply_filters( 'bp_get_group_name', $current_group_name );
     5857                $current_group = groups_get_current_group();
     5858                $current_name  = bp_get_group_name( $current_group );
    58625859
    58635860                /**
     
    58665863                 * @since 1.2.0
    58675864                 *
    5868                  * @param string $name          Name of the current group.
     5865                 * @param string $current_name  Name of the current group.
    58695866                 * @param object $current_group Instance holding the current group.
    58705867                 */
    5871                 return apply_filters( 'bp_get_current_group_name', $name, $current_group );
     5868                return apply_filters( 'bp_get_current_group_name', $current_name, $current_group );
    58725869        }
    58735870
Note: See TracChangeset for help on using the changeset viewer.