bp_activity_get_where_conditions

Filters the MySQL WHERE conditions for the Activity items get method.

Description

apply_filters( 'bp_activity_get_where_conditions', (array) $where_conditions, (array) $r, (string) $select_sql, (string) $from_sql, (string) $join_sql ); 

Parameters (5)

0. $where_conditions (array)
Current conditions for MySQL WHERE statement.
1. $r (array)
Parsed arguments passed into method.
2. $select_sql (string)
Current SELECT MySQL statement at point of execution.
3. $from_sql (string)
Current FROM MySQL statement at point of execution.
4. $join_sql (string)
Current INNER JOIN MySQL statement at point of execution.

Usage

To run the hook, copy the example below.
  1. $where_conditions = apply_filters( 'bp_activity_get_where_conditions', $where_conditions, $r, $select_sql, $from_sql, $join_sql ); 
  2.  
  3. if ( !empty( $where_conditions ) ) { 
  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_where_conditions callback 
  2. function filter_bp_activity_get_where_conditions( $where_conditions, $r, $select_sql, $from_sql, $join_sql ) { 
  3. // make filter magic happen here... 
  4. return $where_conditions
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_activity_get_where_conditions', 'filter_bp_activity_get_where_conditions', 10, 5 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_activity_get_where_conditions', 'filter_bp_activity_get_where_conditions', 10, 5 ); 

Defined (1)

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

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