bp_core_get_paged_users_sql

Filters the SQL used to query for paged users.

Description

apply_filters( 'bp_core_get_paged_users_sql', (array) $join, (array) $sql ); 

Parameters (2)

0. $join (array) => join( ' ', (array) $sql )
Concatenated SQL statement for the query.
1. $sql (array)
Array of SQL statement parts for the query.

Usage

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

Defined (1)

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

/bp-core/classes/class-bp-core-user.php  
  1. $paged_users_sql = apply_filters( 'bp_core_get_paged_users_sql', join( ' ', (array) $sql ), $sql );