- Timestamp:
- 04/16/2021 05:29:26 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/classes/class-bp-xprofile-group.php
r12868 r12885 239 239 * @since 1.2.0 240 240 * @since 2.4.0 Introduced `$member_type` argument. 241 * @since 8.0.0 Introduced `$hide_field_types` argument.241 * @since 8.0.0 Introduced `$hide_field_types` & `$signup_fields_only` arguments. 242 242 * 243 243 * @global object $wpdb WordPress DB access object. … … 245 245 * @param array $args { 246 246 * Array of optional arguments: 247 * @type int $profile_group_id Limit results to a single profile group. 248 * @type int $user_id Required if you want to load a specific user's data. 249 * Default: displayed user's ID. 250 * @type array|string $member_type Limit fields by those restricted to a given member type, or array of 251 * member types. If `$user_id` is provided, the value of `$member_type` 252 * will be overridden by the member types of the provided user. The 253 * special value of 'any' will return only those fields that are 254 * unrestricted by member type - i.e., those applicable to any type. 255 * @type bool $hide_empty_groups True to hide groups that don't have any fields. Default: false. 256 * @type bool $hide_empty_fields True to hide fields where the user has not provided data. 257 * Default: false. 258 * @type bool $fetch_fields Whether to fetch each group's fields. Default: false. 259 * @type bool $fetch_field_data Whether to fetch data for each field. Requires a $user_id. 260 * Default: false. 261 * @type int[]|bool $exclude_groups Comma-separated list or array of group IDs to exclude. 262 * @type int[]|bool $exclude_fields Comma-separated list or array of field IDs to exclude. 263 * @type string[] $hide_field_types List of field types to hide form loop. Default: empty array. 264 * @type bool $update_meta_cache Whether to pre-fetch xprofilemeta for all retrieved groups, fields, 265 * and data. Default: true. 247 * @type int $profile_group_id Limit results to a single profile group. 248 * @type int $user_id Required if you want to load a specific user's data. 249 * Default: displayed user's ID. 250 * @type array|string $member_type Limit fields by those restricted to a given member type, or array of 251 * member types. If `$user_id` is provided, the value of `$member_type` 252 * will be overridden by the member types of the provided user. The 253 * special value of 'any' will return only those fields that are 254 * unrestricted by member type - i.e., those applicable to any type. 255 * @type bool $hide_empty_groups True to hide groups that don't have any fields. Default: false. 256 * @type bool $hide_empty_fields True to hide fields where the user has not provided data. 257 * Default: false. 258 * @type bool $fetch_fields Whether to fetch each group's fields. Default: false. 259 * @type bool $fetch_field_data Whether to fetch data for each field. Requires a $user_id. 260 * Default: false. 261 * @type int[]|bool $exclude_groups Comma-separated list or array of group IDs to exclude. 262 * @type int[]|bool $exclude_fields Comma-separated list or array of field IDs to exclude. 263 * @type string[] $hide_field_types List of field types to hide form loop. Default: empty array. 264 * @type bool $signup_fields_only Whether to only return signup fields. Default: false. 265 * @type bool $update_meta_cache Whether to pre-fetch xprofilemeta for all retrieved groups, fields, 266 * and data. Default: true. 266 267 * } 267 268 * @return array $groups … … 284 285 'hide_field_types' => array(), 285 286 'update_meta_cache' => true, 287 'signup_fields_only' => false, 286 288 ) ); 287 289 … … 343 345 $fields = array(); 344 346 foreach ( $field_ids as $field_id ) { 347 if ( true === $r['signup_fields_only'] && ! in_array( $field_id, bp_xprofile_get_signup_field_ids(), true ) ) { 348 continue; 349 } 350 345 351 $_field = xprofile_get_field( $field_id, null, false ); 346 352
Note: See TracChangeset
for help on using the changeset viewer.