bp_activity_get_join_sql

Filter the MySQL JOIN clause for the main activity query.

Description

apply_filters( 'bp_activity_get_join_sql', (string) $join_sql, (array) $r, (string) $select_sql, (string) $from_sql, (string) $where_sql ); 

Parameters (5)

0. $join_sql (string)
The join sql.
1. $r (array)
Method parameters.
2. $select_sql (string)
Current SELECT MySQL statement.
3. $from_sql (string)
Current FROM MySQL statement.
4. $where_sql (string)
Current WHERE MySQL statement.

Usage

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

Defined (1)

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

/bp-activity/classes/class-bp-activity-activity.php  
  1. $join_sql = apply_filters( 'bp_activity_get_join_sql', $join_sql, $r, $select_sql, $from_sql, $where_sql );