Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/19/2014 07:28:36 PM (10 years ago)
Author:
boonebgorges
Message:

Correct query concatenation for exclude_groups param in BP_XProfile_Group::get()

The previous format was not working properly when passing multiple group ids.

Fixes #5649

Props imath

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-classes.php

    r8347 r8430  
    151151        $where_sql = '';
    152152
    153         if ( !empty( $profile_group_id ) )
     153        if ( ! empty( $profile_group_id ) ) {
    154154            $where_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id );
    155         elseif ( $exclude_groups )
    156             $where_sql = $wpdb->prepare( "WHERE g.id NOT IN ({$exclude_groups})");
     155        } else if ( $exclude_groups ) {
     156            $exclude_groups = join( ',', wp_parse_id_list( $exclude_groups ) );
     157            $where_sql = "WHERE g.id NOT IN ({$exclude_groups})";
     158        }
    157159
    158160        if ( ! empty( $hide_empty_groups ) ) {
Note: See TracChangeset for help on using the changeset viewer.