Skip to:
Content

BuddyPress.org

Changeset 7147


Ignore:
Timestamp:
06/04/2013 03:17:12 AM (12 years ago)
Author:
boonebgorges
Message:

Allow BP_Group_Member_Query::get_group_member_ids() to fetch all matching records

Previously, the per_page parameter was applied to this utility method for
efficiency's sake. However, this caused problems for the total_users count of
the parent BP_User_Query class, which would always return the per_page value
instead of the actual total matching row count.

This change will be necessary to implement pagination as required in #4977

File:
1 edited

Legend:

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

    r7145 r7147  
    10891089
    10901090        /** LIMIT clause ******************************************************/
    1091 
    1092         // Technically, this is also handled by BP_User_Query, but
    1093         // repeating the limit here helps to make the query more
    1094         // efficient, by not fetching every single matching user
    1095         if ( ! empty( $this->query_vars['per_page'] ) && ! empty( $this->query_vars['page'] ) ) {
    1096             $sql['limit'] = $wpdb->prepare( "LIMIT %d, %d", absint( ( $this->query_vars['page'] - 1 ) * $this->query_vars['per_page'] ), absint( $this->query_vars['per_page'] ) );
    1097         }
    10981091
    10991092        $ids = $wpdb->get_col( "{$sql['select']} {$sql['where']} {$sql['orderby']} {$sql['order']} {$sql['limit']}" );
Note: See TracChangeset for help on using the changeset viewer.