diff --git bp-groups/bp-groups-classes.php bp-groups/bp-groups-classes.php
index f5a0efa..77cd576 100644
|
|
|
class BP_Groups_Group {
|
| 465 | 465 | $total_sql['where'][] = $wpdb->prepare( "m.group_id = g.id AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $r['user_id'] ); |
| 466 | 466 | } |
| 467 | 467 | |
| | 468 | // Temporary implementation of meta_query for total count |
| | 469 | // See #5099 |
| | 470 | if ( ! empty( $meta_query_sql['where'] ) ) { |
| | 471 | // Join the groupmeta table |
| | 472 | $total_sql['select'] .= ", {$bp->groups->table_name_groupmeta} gmmq"; |
| | 473 | |
| | 474 | // Modify the meta_query clause from paged_sql for our syntax |
| | 475 | $meta_query_clause = preg_replace( '/^\s*AND/', '', $meta_query_sql['where'] ); |
| | 476 | $meta_query_clause = str_replace( $bp->groups->table_name_groupmeta, 'gmmq', $meta_query_clause ); |
| | 477 | $total_sql['where'][] = $meta_query_clause; |
| | 478 | } |
| | 479 | |
| 468 | 480 | // Already escaped in the paginated results block |
| 469 | 481 | if ( ! empty( $include ) ) { |
| 470 | 482 | $total_sql['where'][] = "g.id IN ({$include})"; |