Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/09/2010 12:59:25 PM (14 years ago)
Author:
boonebgorges
Message:

Adds several exclude parameters to bp_has_profile(). Fixes #2655

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-templatetags.php

    r3377 r3381  
    1818    var $user_id;
    1919
    20     function bp_xprofile_data_template( $user_id, $profile_group_id ) {
     20    function bp_xprofile_data_template( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false ) {
    2121        $this->groups = BP_XProfile_Group::get( array(
    22             'profile_group_id' => $profile_group_id,
    23             'user_id' => $user_id,
    24             'hide_empty_groups' => true,
    25             'fetch_fields' => true,
    26             'fetch_field_data' => true
     22            'profile_group_id'  => $profile_group_id,
     23            'user_id'           => $user_id,
     24            'hide_empty_groups' => $hide_empty_groups,
     25            'fetch_fields'      => $fetch_fields,
     26            'fetch_field_data'  => $fetch_field_data,
     27            'exclude_groups'    => $exclude_groups,
     28            'exclude_fields'    => $exclude_fields
    2729        ) );
    2830
     
    145147    $defaults = array(
    146148        'user_id' => $bp->displayed_user->id,
    147         'profile_group_id' => false
     149        'profile_group_id' => false,
     150        'hide_empty_groups' => true,
     151        'fetch_fields'      => true,
     152        'fetch_field_data'  => true,
     153        'exclude_groups' => false, // Comma-separated list of profile field group IDs to exclude
     154        'exclude_fields' => false // Comma-separated list of profile field IDs to exclude
    148155    );
    149156
     
    151158    extract( $r, EXTR_SKIP );
    152159
    153     $profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id );
     160    $profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id, $hide_empty_groups, $fetch_fields, $fetch_field_data, $exclude_groups, $exclude_fields );
    154161    return apply_filters( 'bp_has_profile', $profile_template->has_groups(), &$profile_template );
    155162}
Note: See TracChangeset for help on using the changeset viewer.