Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/23/2010 11:17:59 PM (15 years ago)
Author:
boonebgorges
Message:

Adds parameter to bp_has_activities chain to allow filters to apply only within a given set of activity ids. Fixes activity filtering on Favorites tab. Fixes #2442

File:
1 edited

Legend:

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

    r3373 r3480  
    8989    // Static Functions
    9090
    91     function get( $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $search_terms = false, $filter = false, $display_comments = false, $show_hidden = false, $exclude = false ) {
     91    function get( $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $search_terms = false, $filter = false, $display_comments = false, $show_hidden = false, $exclude = false, $in = false ) {
    9292        global $wpdb, $bp;
    9393
     
    121121        if ( $exclude )
    122122            $where_conditions['exclude'] = "a.id NOT IN ({$exclude})";
     123       
     124        // The specific ids to which you want to limit the query
     125        if ( !empty( $in ) ) {
     126            if ( is_array( $in ) )
     127                $in = implode( ',', $in );
     128            $where_conditions['in'] = "a.id IN ({$in})";
     129        }
    123130
    124131        // Alter the query based on whether we want to show activity item comments in the stream like normal comments or threaded below the activity
Note: See TracChangeset for help on using the changeset viewer.