Changeset 11523 for trunk/src/bp-groups/classes/class-bp-groups-group.php
- Timestamp:
- 04/05/2017 12:00:40 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/classes/class-bp-groups-group.php
r11447 r11523 861 861 * @since 2.6.0 Added `$group_type`, `$group_type__in`, and `$group_type__not_in` parameters. 862 862 * @since 2.7.0 Added `$update_admin_cache` and `$parent_id` parameters. 863 * @since 2.9.0 Added `$slug` parameter. 863 864 * 864 865 * @param array $args { … … 877 878 * @type int $user_id Optional. If provided, results will be limited to groups 878 879 * of which the specified user is a member. Default: null. 879 * @type string $search_terms Optional. If provided, only groups whose names or descriptions 880 * @type array|string $slug Optional. Array or comma-separated list of group slugs to limit 881 * results to. 882 * Default: false. 883 * @type string $search_terms Optional. If provided, only groups whose names or descriptions 880 884 * match the search terms will be returned. Allows specifying the 881 885 * wildcard position using a '*' character before or after the … … 939 943 'page' => null, 940 944 'user_id' => 0, 945 'slug' => array(), 941 946 'search_terms' => false, 942 947 'search_columns' => array(), … … 973 978 if ( empty( $r['show_hidden'] ) ) { 974 979 $where_conditions['hidden'] = "g.status != 'hidden'"; 980 } 981 982 if ( ! empty( $r['slug'] ) ) { 983 if ( ! is_array( $r['slug'] ) ) { 984 $r['slug'] = preg_split( '/[\s,]+/', $r['slug'] ); 985 } 986 $r['slug'] = array_map( 'sanitize_title', $r['slug'] ); 987 $slug_in = "'" . implode( "','", $r['slug'] ) . "'"; 988 $where_conditions['slug'] = "g.slug IN ({$slug_in})"; 975 989 } 976 990
Note: See TracChangeset
for help on using the changeset viewer.