Changeset 11533 for trunk/src/bp-groups/classes/class-bp-groups-group.php
- Timestamp:
- 04/20/2017 12:56:53 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/classes/class-bp-groups-group.php
r11532 r11533 884 884 * Default: null. 885 885 * @type string $orderby Optional. Property to sort by. 'date_created', 'last_activity', 886 * 'total_member_count', 'name', 'random'. Default: 'date_created'. 886 * 'total_member_count', 'name', 'random', 'meta_id'. 887 * Default: 'date_created'. 887 888 * @type string $order Optional. Sort order. 'ASC' or 'DESC'. Default: 'DESC'. 888 889 * @type int $per_page Optional. Number of items to return per page of results. … … 994 995 $where_conditions = array(); 995 996 996 997 997 if ( ! empty( $r['status'] ) ) { 998 998 if ( ! is_array( $r['status'] ) ) { … … 1139 1139 $sql['from'] .= " JOIN {$bp->groups->table_name_groupmeta} gm_last_activity on ( g.id = gm_last_activity.group_id )"; 1140 1140 $where_conditions['last_activity'] = "gm_last_activity.meta_key = 'last_activity'"; 1141 } 1142 1143 // If 'meta_id' is the requested order, and there's no meta query, fall back to the default. 1144 if ( 'meta_id' === $orderby && empty( $meta_query_sql['join'] ) ) { 1145 $orderby = 'date_created'; 1141 1146 } 1142 1147 … … 1443 1448 $order_by_term = 'rand()'; 1444 1449 break; 1450 1451 case 'meta_id' : 1452 $order_by_term = buddypress()->groups->table_name_groupmeta . '.id'; 1453 break; 1445 1454 } 1446 1455
Note: See TracChangeset
for help on using the changeset viewer.