bp_get_current_group_slug
Filters the slug of the current group.
Description
apply_filters( 'bp_get_current_group_slug', (string) $current_group_slug, (object) $current_group );
Parameters (2)
- 0. $current_group_slug (string)
- Slug of the current group.
- 1. $current_group (object)
- Instance holding the current group.
Usage
- To run the hook, copy the example below.
- $current_group_slug = apply_filters( 'bp_get_current_group_slug', $current_group_slug, $current_group );
- if ( !empty( $current_group_slug ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the bp_get_current_group_slug callback
- function filter_bp_get_current_group_slug( $current_group_slug, $current_group ) {
- // make filter magic happen here...
- return $current_group_slug;
- };
- // add the filter
- add_filter( 'bp_get_current_group_slug', 'filter_bp_get_current_group_slug', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'bp_get_current_group_slug', 'filter_bp_get_current_group_slug', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /bp-groups/bp-groups-template.php
- return apply_filters( 'bp_get_current_group_slug', $current_group_slug, $current_group );