bp_group_has_moderators
Filters whether a group has moderators.
Description
Parameters (2)
- 0. $groups_get_group_mods (array) =>
groups_get_group_mods( $group->id )
- Array of user IDs who are a moderator of the provided group.
- 1. $group (object)
- Group object.
Usage
- To run the hook, copy the example below.
- $groups_get_group_mods = apply_filters( 'bp_group_has_moderators', $groups_get_group_mods, $group );
- if ( !empty( $groups_get_group_mods ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the bp_group_has_moderators callback
- function filter_bp_group_has_moderators( $groups_get_group_mods, $group ) {
- // make filter magic happen here...
- return $groups_get_group_mods;
- };
- // add the filter
- add_filter( 'bp_group_has_moderators', 'filter_bp_group_has_moderators', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'bp_group_has_moderators', 'filter_bp_group_has_moderators', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /bp-groups/bp-groups-template.php
- return apply_filters( 'bp_group_has_moderators', groups_get_group_mods( $group->id ), $group );