bp_activity_get_user_join_filter

The BuddyPress bp activity get user join filter hook.

Description

apply_filters( 'bp_activity_get_user_join_filter', (string) $select_sql_from_sql_join_sql_where_sql_order_by_a_date_recorded_sort_a_id_sort_pag_sql, (unknown) $select_sql, (unknown) $from_sql, (unknown) $where_sql, (unknown) $sort, (unknown) $pag_sql ); 

Parameters (6)

0. $select_sql_from_sql_join_sql_where_sql_order_by_a_date_recorded_sort_a_id_sort_pag_sql (string) => "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}, a.id {$sort} {$pag_sql}"
The select sql from sql join sql where sql order by a date recorded sort a id sort pag sql.
1. $select_sql (unknown)
The select sql.
2. $from_sql (unknown)
The from sql.
3. $where_sql (unknown)
The where sql.
4. $sort (unknown)
The sort.
5. $pag_sql (unknown)
The pag sql.

Usage

To run the hook, copy the example below.
  1. $select_sql_from_sql_join_sql_where_sql_order_by_a_date_recorded_sort_a_id_sort_pag_sql = apply_filters( 'bp_activity_get_user_join_filter', $select_sql_from_sql_join_sql_where_sql_order_by_a_date_recorded_sort_a_id_sort_pag_sql, $select_sql, $from_sql, $where_sql, $sort, $pag_sql ); 
  2.  
  3. if ( !empty( $select_sql_from_sql_join_sql_where_sql_order_by_a_date_recorded_sort_a_id_sort_pag_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_user_join_filter callback 
  2. function filter_bp_activity_get_user_join_filter( $select_sql_from_sql_join_sql_where_sql_order_by_a_date_recorded_sort_a_id_sort_pag_sql, $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) { 
  3. // make filter magic happen here... 
  4. return $select_sql_from_sql_join_sql_where_sql_order_by_a_date_recorded_sort_a_id_sort_pag_sql
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_activity_get_user_join_filter', 'filter_bp_activity_get_user_join_filter', 10, 6 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_activity_get_user_join_filter', 'filter_bp_activity_get_user_join_filter', 10, 6 ); 

Defined (2)

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

/bp-activity/classes/class-bp-activity-activity.php  
  1. $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}, a.id {$sort} {$pag_sql}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) ); 
  1. $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}, a.id {$sort}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );