Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/10/2014 08:33:24 PM (12 years ago)
Author:
boonebgorges
Message:

Introduce bp_xprofile_get_groups() procedural wrapper for BP_XProfile_Group::get()

This wrapper includes a filter on the return values, so that plugin authors can
manipulate data programatically.

Also includes some documentation improvements, and implements new function
throughout BP.

See #5657

Props tw2113

File:
1 edited

Legend:

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

    r8672 r8785  
    109109         * @global BuddyPress $bp The one true BuddyPress instance
    110110         *
    111          * @param array $args Takes an array of parameters:
    112          *              'profile_group_id' - Limit results to a single profile group
    113          *              'user_id' - Required if you want to load a specific user's data
    114          *              'hide_empty_groups' - Hide groups without any fields
    115          *              'hide_empty_fields' - Hide fields where the user has not provided data
    116          *              'fetch_fields' - Load each group's fields
    117          *              'fetch_field_data' - Load each field's data. Requires a user_id
    118          *              'exclude_groups' - Comma-separated list of groups to exclude
    119          *              'exclude_fields' - Comma-separated list of fields to exclude
    120          *              'update_meta_cache' - Whether to pre-fetch xprofilemeta
    121          *                 for all retrieved groups, fields, and data
    122          *
     111         * @param array $args {
     112         *      Array of optional arguments:
     113         *      @type int $profile_group_id Limit results to a single profile
     114         *            group.
     115         *      @type int $user_id Required if you want to load a specific
     116         *            user's data. Default: displayed user's ID.
     117         *      @type bool $hide_empty_groups True to hide groups that don't
     118         *            have any fields. Default: false.
     119         *      @type bool $hide_empty_fields True to hide fields where the
     120         *            user has not provided data. Default: false.
     121         *      @type bool $fetch_fields Whether to fetch each group's fields.
     122         *            Default: false.
     123         *      @type bool $fetch_field_data Whether to fetch data for each
     124         *            field. Requires a $user_id. Default: false.
     125         *      @type array $exclude_groups Comma-separated list or array of
     126         *            group IDs to exclude.
     127         *      @type array $exclude_fields Comma-separated list or array of
     128         *            field IDs to exclude.
     129         *      @type bool $update_meta_cache Whether to pre-fetch xprofilemeta
     130         *            for all retrieved groups, fields, and data. Default: true.
     131         * }
    123132         * @return array $groups
    124133         */
     
    12241233                global $wpdb, $bp;
    12251234
    1226                 $groups = BP_XProfile_Group::get( array(
     1235                $groups = bp_xprofile_get_groups( array(
    12271236                        'user_id'                => $user_id,
    12281237                        'hide_empty_groups'      => true,
Note: See TracChangeset for help on using the changeset viewer.