Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/08/2022 06:27:01 AM (3 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/bp-xprofile-template.php

    r13108 r13358  
    1515 *
    1616 * @since 1.0.0
    17  * @since 2.4.0 Introduced `$member_type` argument.
    18  * @since 8.0.0 Introduced `$hide_field_types` & `$signup_fields_only` arguments.
     17 * @since 2.4.0  Introduced `$member_type` argument.
     18 * @since 8.0.0  Introduced `$hide_field_types` & `$signup_fields_only` arguments.
     19 * @since 11.0.0 `$profile_group_id` accepts an array of profile group ids.
    1920 *
    2021 * @global object $profile_template
     
    2425 *     Array of arguments. See BP_XProfile_Group::get() for full description. Those arguments whose defaults differ
    2526 *     from that method are described here:
    26  *     @type int          $user_id                Default: ID of the displayed user.
    27  *     @type string|array $member_type            Default: 'any'.
    28  *     @type int|bool    $profile_group_id       Default: false.
    29  *     @type bool         $hide_empty_groups      Default: true.
    30  *     @type bool         $hide_empty_fields      Defaults to true on the Dashboard, on a user's Edit Profile page,
    31  *                                                or during registration. Otherwise false.
    32  *     @type bool         $fetch_fields           Default: true.
    33  *     @type bool         $fetch_field_data       Default: true.
    34  *     @type bool         $fetch_visibility_level Defaults to true when an admin is viewing a profile, or when a user is
    35  *                                                viewing her own profile, or during registration. Otherwise false.
    36  *     @type int[]|bool   $exclude_groups         Default: false.
    37  *     @type int[]|bool   $exclude_fields         Default: false.
    38  *     @type string[]     $hide_field_types       Default: empty array.
    39  *     @type bool         $signup_fields_only     Default: false.
    40  *     @type bool         $update_meta_cache      Default: true.
     27 *     @type int            $user_id                Default: ID of the displayed user.
     28 *     @type string|array   $member_type            Default: 'any'.
     29 *     @type int|int[]|bool $profile_group_id       Default: false.
     30 *     @type bool           $hide_empty_groups      Default: true.
     31 *     @type bool           $hide_empty_fields      Defaults to true on the Dashboard, on a user's Edit Profile page,
     32 *                                                  or during registration. Otherwise false.
     33 *     @type bool           $fetch_fields           Default: true.
     34 *     @type bool           $fetch_field_data       Default: true.
     35 *     @type bool           $fetch_visibility_level Defaults to true when an admin is viewing a profile, or when a user is
     36 *                                                  viewing her own profile, or during registration. Otherwise false.
     37 *     @type int[]|bool     $exclude_groups         Default: false.
     38 *     @type int[]|bool     $exclude_fields         Default: false.
     39 *     @type string[]       $hide_field_types       Default: empty array.
     40 *     @type bool           $signup_fields_only     Default: false.
     41 *     @type bool           $update_meta_cache      Default: true.
    4142 * }
    42  *
    4343 * @return bool
    4444 */
Note: See TracChangeset for help on using the changeset viewer.