Changeset 9977 for trunk/src/bp-core/classes/class-bp-user-query.php
- Timestamp:
- 06/29/2015 03:06:53 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-user-query.php
r9976 r9977 20 20 * @param array $query { 21 21 * Query arguments. All items are optional. 22 * @type string $type Determines sort order. Select from 'newest', 'active', 'online', 23 * 'random', 'popular', 'alphabetical'. Default: 'newest'. 24 * @type int $per_page Number of results to return. Default: 0 (no limit). 25 * @type int $page Page offset (together with $per_page). Default: 1. 26 * @type int $user_id ID of a user. If present, and if the friends component is activated, 27 * results will be limited to the friends of that user. Default: 0. 28 * @type string|bool $search_terms Terms to search by. Search happens across xprofile fields. Requires 29 * XProfile component. Default: false. 30 * @type string $search_wildcard When searching with $search_terms, set where wildcards around the term 31 * should be positioned. Accepts 'both', 'left', 'right'. Default: 'both'. 32 * @type array|string|bool $include An array or comma-separated list of user IDs to which query should 33 * be limited. Default: false. 34 * @type array|string|bool $exclude An array or comma-separated list of user IDs that will be excluded from 35 * query results. Default: false. 36 * @type array|string|bool $user_ids An array or comma-separated list of IDs corresponding to the users 37 * that should be returned. When this parameter is passed, it will 38 * override all others; BP User objects will be constructed using these 39 * IDs only. Default: false. 40 * @type array|string $member_type Array or comma-separated list of member types to limit results to. 41 * @type array|string $member_type__in Array or comma-separated list of member types to limit results to. 22 * @type string $type Determines sort order. Select from 'newest', 'active', 'online', 23 * 'random', 'popular', 'alphabetical'. Default: 'newest'. 24 * @type int $per_page Number of results to return. Default: 0 (no limit). 25 * @type int $page Page offset (together with $per_page). Default: 1. 26 * @type int $user_id ID of a user. If present, and if the friends component is activated, 27 * results will be limited to the friends of that user. Default: 0. 28 * @type string|bool $search_terms Terms to search by. Search happens across xprofile fields. Requires 29 * XProfile component. Default: false. 30 * @type string $search_wildcard When searching with $search_terms, set where wildcards around the 31 * term should be positioned. Accepts 'both', 'left', 'right'. 32 * Default: 'both'. 33 * @type array|string|bool $include An array or comma-separated list of user IDs to which query should 34 * be limited. Default: false. 35 * @type array|string|bool $exclude An array or comma-separated list of user IDs that will be excluded 36 * from query results. Default: false. 37 * @type array|string|bool $user_ids An array or comma-separated list of IDs corresponding to the users 38 * that should be returned. When this parameter is passed, it will 39 * override all others; BP User objects will be constructed using these 40 * IDs only. Default: false. 41 * @type array|string $member_type Array or comma-separated list of member types to limit results to. 42 * @type array|string $member_type__in Array or comma-separated list of member types to limit results to. 42 43 * @type array|string $member_type__not_in Array or comma-separated list of member types that will be 43 44 * excluded from results. 44 * @type string|bool $meta_key Limit results to users that have usermeta associated with this meta_key.45 * Usually used with $meta_value. Default: false.46 * @type string|bool $meta_value When used with $meta_key, limits results to users whose usermeta value47 * associated with $meta_key matches $meta_value. Default: false.48 * @type array $xprofile_query Filter results by xprofile data. Requires the xprofile component. See49 * {@see BP_XProfile_Query} for details.50 * @type bool $populate_extras True if you want to fetch extra metadata51 * about returned users, such as total group and friend counts.52 * @type string $count_total Determines how BP_User_Query will do a count of total users matching53 * the other filter criteria. Default value is 'count_query', which does54 * a separate SELECT COUNT query to determine the total.55 * 'sql_count_found_rows' uses SQL_COUNT_FOUND_ROWS and56 * SELECT FOUND_ROWS(). Pass an empty string to skip the total user57 * count query.45 * @type string|bool $meta_key Limit results to users that have usermeta associated with this meta_key. 46 * Usually used with $meta_value. Default: false. 47 * @type string|bool $meta_value When used with $meta_key, limits results to users whose usermeta value 48 * associated with $meta_key matches $meta_value. Default: false. 49 * @type array $xprofile_query Filter results by xprofile data. Requires the xprofile component. 50 * See {@see BP_XProfile_Query} for details. 51 * @type bool $populate_extras True if you want to fetch extra metadata 52 * about returned users, such as total group and friend counts. 53 * @type string $count_total Determines how BP_User_Query will do a count of total users matching 54 * the other filter criteria. Default value is 'count_query', which 55 * does a separate SELECT COUNT query to determine the total. 56 * 'sql_count_found_rows' uses SQL_COUNT_FOUND_ROWS and 57 * SELECT FOUND_ROWS(). Pass an empty string to skip the total user 58 * count query. 58 59 * } 59 60 */ … … 160 161 if ( ! empty( $this->query_vars_raw ) ) { 161 162 $this->query_vars = wp_parse_args( $this->query_vars_raw, array( 162 'type' => 'newest',163 'per_page' => 0,164 'page' => 1,165 'user_id' => 0,166 'search_terms' => false,167 'search_wildcard' => 'both',168 'include' => false,169 'exclude' => false,170 'user_ids' => false,171 'member_type' => '',172 'member_type__in' => '',163 'type' => 'newest', 164 'per_page' => 0, 165 'page' => 1, 166 'user_id' => 0, 167 'search_terms' => false, 168 'search_wildcard' => 'both', 169 'include' => false, 170 'exclude' => false, 171 'user_ids' => false, 172 'member_type' => '', 173 'member_type__in' => '', 173 174 'member_type__not_in' => '', 174 'meta_key' => false,175 'meta_value' => false,176 'xprofile_query' => false,177 'populate_extras' => true,178 'count_total' => 'count_query'175 'meta_key' => false, 176 'meta_value' => false, 177 'xprofile_query' => false, 178 'populate_extras' => true, 179 'count_total' => 'count_query' 179 180 ) ); 180 181
Note: See TracChangeset
for help on using the changeset viewer.