Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/08/2022 06:27:01 AM (4 years ago)
Author:
imath
Message:

xProfile: allow the loop to fetch fields from multiple fields group

You can now pass an array of fields group ID into the $profile_group_id
parameter.

Props boonebgorges, espellcaste

Closes https://github.com/buddypress/buddypress/pull/30
Fixes #4075

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-data-template.php

    r13108 r13358  
    105105         *
    106106         * @since 1.5.0
    107          * @since 2.4.0 Introduced `$member_type` argument.
    108          * @since 8.0.0 Introduced `$hide_field_types` & `$signup_fields_only` arguments.
     107         * @since 2.4.0  Introduced `$member_type` argument.
     108         * @since 8.0.0  Introduced `$hide_field_types` & `$signup_fields_only` arguments.
     109         * @since 11.0.0 `$profile_group_id` accepts an array of profile group ids.
    109110         *
    110111         * @param array|string $args {
    111112         *     An array of arguments. All items are optional.
    112113         *
    113          *     @type int          $user_id                 Fetch field data for this user ID.
    114          *     @type string|array $member_type             Limit results to those matching member type(s).
    115          *     @type int          $profile_group_id        Field group to fetch fields & data for.
    116          *     @type int|bool     $hide_empty_groups       Should empty field groups be skipped.
    117          *     @type int|bool     $fetch_fields            Fetch fields for field group.
    118          *     @type int|bool     $fetch_field_data        Fetch field data for fields in group.
    119          *     @type array        $exclude_groups          Exclude these field groups.
    120          *     @type array        $exclude_fields          Exclude these fields.
    121          *     @type int|bool     $hide_empty_fields       Should empty fields be skipped.
    122          *     @type int|bool     $fetch_visibility_level  Fetch visibility levels.
    123          *     @type string[]     $hide_field_types        List of field types to hide form loop. Default: empty array.
    124          *     @type bool         $signup_fields_only      Whether to only return signup fields. Default: false.
    125          *     @type int|bool     $update_meta_cache       Should metadata cache be updated.
     114         *     @type int            $user_id                 Fetch field data for this user ID.
     115         *     @type string|array   $member_type             Limit results to those matching member type(s).
     116         *     @type int|int[]|bool $profile_group_id        Field group(s) to fetch fields & data for. Default: false.
     117         *     @type int|bool       $hide_empty_groups       Should empty field groups be skipped.
     118         *     @type int|bool       $fetch_fields            Fetch fields for field group.
     119         *     @type int|bool       $fetch_field_data        Fetch field data for fields in group.
     120         *     @type array          $exclude_groups          Exclude these field groups.
     121         *     @type array          $exclude_fields          Exclude these fields.
     122         *     @type int|bool       $hide_empty_fields       Should empty fields be skipped.
     123         *     @type int|bool       $fetch_visibility_level  Fetch visibility levels.
     124         *     @type string[]       $hide_field_types        List of field types to hide form loop. Default: empty array.
     125         *     @type bool           $signup_fields_only      Whether to only return signup fields. Default: false.
     126         *     @type int|bool       $update_meta_cache       Should metadata cache be updated.
    126127         * }
    127128         */
Note: See TracChangeset for help on using the changeset viewer.