Skip to:
Content

BuddyPress.org

Ticket #3521: bp_activity_get_filters.patch

File bp_activity_get_filters.patch, 1.0 KB (added by sboisvert, 13 years ago)
  • bp-activity/bp-activity-classes.php

     
    100100
    101101                // Select conditions
    102102                $select_sql = "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name";
    103 
     103                $select_sql = apply_filters( 'bp_activity_get_select_sql', $select_sql);
     104               
    104105                $from_sql = " FROM {$bp->activity->table_name} a LEFT JOIN {$wpdb->users} u ON a.user_id = u.ID";
    105 
     106                $from_sql = apply_filters( 'bp_activity_get_from_sql', $from_sql);
     107               
    106108                // Where conditions
    107109                $where_conditions = array();
    108110
     
    146148                        $where_conditions[] = "a.type != 'activity_comment'";
    147149
    148150                $where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
     151               
     152                $where_sql = apply_filters( 'bp_activity_get_where_sql', $where_sql);
    149153
    150154                if ( $per_page && $page ) {
    151155                        $pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $per_page ), intval( $per_page ) );