bp_group_member_query_group_member_ids

Filters the member IDs for the current group member query.

Description

apply_filters( 'bp_group_member_query_group_member_ids', (array) $this_group_member_ids, (BP_Group_Member_Query) $instance ); 

Use this filter to build a custom query (such as when you've defined a custom type).

Parameters (2)

0. $this_group_member_ids (array)
Array of associated member IDs.
1. $instance (BP_Group_Member_Query)
Current BP_Group_Member_Query instance.

Usage

To run the hook, copy the example below.
  1. $this_group_member_ids = apply_filters( 'bp_group_member_query_group_member_ids', $this_group_member_ids, $instance ); 
  2.  
  3. if ( !empty( $this_group_member_ids ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_group_member_query_group_member_ids callback 
  2. function filter_bp_group_member_query_group_member_ids( $this_group_member_ids, $instance ) { 
  3. // make filter magic happen here... 
  4. return $this_group_member_ids
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_group_member_query_group_member_ids', 'filter_bp_group_member_query_group_member_ids', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_group_member_query_group_member_ids', 'filter_bp_group_member_query_group_member_ids', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/bp-groups/classes/class-bp-group-member-query.php  
  1. $this->group_member_ids = apply_filters( 'bp_group_member_query_group_member_ids', $this->group_member_ids, $this );