Changeset 11532 for trunk/src/bp-groups/classes/class-bp-groups-group.php
- Timestamp:
- 04/20/2017 12:19:36 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/classes/class-bp-groups-group.php
r11530 r11532 920 920 * groups. Default: false. 921 921 * @type bool $show_hidden Whether to include hidden groups in results. Default: false. 922 * @type array|string $status Optional. Array or comma-separated list of group statuses to limit 923 * results to. If specified, $show_hidden is ignored. 924 * Default: empty array. 922 925 * } 923 926 * @return array { … … 970 973 'exclude' => false, 971 974 'show_hidden' => false, 975 'status' => array() 972 976 ); 973 977 … … 990 994 $where_conditions = array(); 991 995 992 if ( empty( $r['show_hidden'] ) ) { 996 997 if ( ! empty( $r['status'] ) ) { 998 if ( ! is_array( $r['status'] ) ) { 999 $r['status'] = preg_split( '/[\s,]+/', $r['status'] ); 1000 } 1001 $r['status'] = array_map( 'sanitize_title', $r['status'] ); 1002 $status_in = "'" . implode( "','", $r['status'] ) . "'"; 1003 $where_conditions['status'] = "g.status IN ({$status_in})"; 1004 } elseif ( empty( $r['show_hidden'] ) ) { 993 1005 $where_conditions['hidden'] = "g.status != 'hidden'"; 994 1006 }
Note: See TracChangeset
for help on using the changeset viewer.