Skip to:
Content

BuddyPress.org

Changeset 5916


Ignore:
Timestamp:
03/13/2012 09:57:01 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Use wp_parse_id_list() in BP_Activity_Activity::get(). Props paulgibbs. (branches/1.5)

File:
1 edited

Legend:

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

    r5911 r5916  
    138138                // Exclude specified items
    139139                if ( !empty( $exclude ) ) {
    140                         if ( is_array( $exclude ) ) {
    141                                 $exclude = implode ( ',', array_map( 'absint', $exclude ) );
    142                         } else {
    143                                 $exclude = implode ( ',', array_map( 'absint', explode ( ',', $exclude ) ) );
    144                         }
    145 
     140                        $exclude = wp_parse_id_list( $exclude );
    146141                        $where_conditions['exclude'] = "a.id NOT IN ({$exclude})";
    147142                }
    … …  
    149144                // The specific ids to which you want to limit the query
    150145                if ( !empty( $in ) ) {
    151                         if ( is_array( $in ) ) {
    152                                 $in = implode ( ',', array_map( 'absint', $in ) );
    153                         } else {
    154                                 $in = implode ( ',', array_map( 'absint', explode ( ',', $in ) ) );
    155                         }
    156 
     146                        $in = wp_parse_id_list( $in );
    157147                        $where_conditions['in'] = "a.id IN ({$in})";
    158148                }
Note: See TracChangeset for help on using the changeset viewer.