Skip to:
Content

BuddyPress.org

Ticket #1721: new_filters.diff

File new_filters.diff, 1.5 KB (added by rvenable, 14 years ago)
  • bp-activity/bp-activity-classes.php

     
    110110                $where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
    111111
    112112                if ( $per_page && $page )
    113                         $activities = $wpdb->get_results( $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}" ) );
     113                        $activities = $wpdb->get_results( apply_filters('bp_activity_get_sql', $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}" ) ) );
    114114                else
    115                         $activities = $wpdb->get_results( $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}" ) );
     115                        $activities = $wpdb->get_results( apply_filters('bp_activity_get_sql', $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}" ) ) );
    116116
    117                 $total_activities = $wpdb->get_var( $wpdb->prepare( "SELECT count(a.id) FROM {$bp->activity->table_name} a {$where_sql} ORDER BY a.date_recorded {$sort}" ) );
    118 
     117                $total_activities = $wpdb->get_var( apply_filters('bp_activity_get_total_sql', $wpdb->prepare( "SELECT count(a.id) FROM {$bp->activity->table_name} a {$where_sql} ORDER BY a.date_recorded {$sort}" ) ) );
     118               
    119119                /* Get the fullnames of users so we don't have to query in the loop */
    120120                if ( function_exists( 'xprofile_install' ) && $activities ) {
    121121                        foreach ( (array)$activities as $activity ) {