Skip to:
Content

BuddyPress.org

Changeset 3617


Ignore:
Timestamp:
12/30/2010 04:46:15 PM (14 years ago)
Author:
boonebgorges
Message:

Adds filters to groups and activities queries to parallel members component. Fixes #2774

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-classes.php

    r3580 r3617  
    143143        }
    144144
    145         $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}" ) );
     145        $total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', $wpdb->prepare( "SELECT count(a.id) FROM {$bp->activity->table_name} a {$where_sql} ORDER BY a.date_recorded {$sort}" ), $where_sql, $sort );
     146
     147        $total_activities = $wpdb->get_var( $total_activities_sql );
    146148
    147149        // Get the fullnames of users so we don't have to query in the loop
  • trunk/bp-groups/bp-groups-classes.php

    r3609 r3617  
    317317
    318318        /* Get paginated results */
    319         $paged_groups = $wpdb->get_results( join( ' ', (array)$sql ) );
     319        $paged_groups_sql = apply_filters( 'bp_groups_get_paged_groups_sql', join( ' ', (array)$sql ), $sql );
     320        $paged_groups = $wpdb->get_results( $paged_groups_sql );
    320321
    321322        $total_sql['select'] = "SELECT COUNT(g.id) FROM {$bp->groups->table_name} g";
     
    344345
    345346        /* Get total group results */
    346         $total_groups = $wpdb->get_var( join( ' ', (array)$t_sql ) );
     347        $total_groups_sql = apply_filters( 'bp_groups_get_total_groups_sql', join( ' ', (array)$sql ), $sql );
     348        $total_groups = $wpdb->get_var( $total_groups_sql );
    347349
    348350        /* Populate some extra information instead of querying each time in the loop */
Note: See TracChangeset for help on using the changeset viewer.