Skip to:
Content

BuddyPress.org

Ticket #5649: 5649.patch

File 5649.patch, 955 bytes (added by imath, 10 years ago)
  • src/bp-xprofile/bp-xprofile-classes.php

    diff --git src/bp-xprofile/bp-xprofile-classes.php src/bp-xprofile/bp-xprofile-classes.php
    index 522bb45..2583b01 100644
    class BP_XProfile_Group { 
    150150
    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                elseif ( $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 ) ) {
    159161                        $group_ids = $wpdb->get_col( "SELECT DISTINCT g.id FROM {$bp->profile->table_name_groups} g INNER JOIN {$bp->profile->table_name_fields} f ON g.id = f.group_id {$where_sql} ORDER BY g.group_order ASC" );