Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/10/2009 06:34:52 PM (16 years ago)
Author:
apeatling
Message:

Added extra filtering on template loops, applies to #980 props jeffsayre.

File:
1 edited

Legend:

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

    r1835 r1844  
    5151
    5252        $this->group = $this->groups[$this->current_group];
    53         $this->field_count = count($this->group->fields);
    5453       
    5554        if ( !$fields = wp_cache_get( 'xprofile_fields_' . $this->group->id . '_' . $this->user_id, 'bp' ) ) {
    56             for ( $i = 0; $i < $this->field_count; $i++ ) {
     55            for ( $i = 0; $i < count($this->group->fields); $i++ ) {
    5756                $field = new BP_XProfile_Field( $this->group->fields[$i]->id, $this->user_id );
    5857                $fields[$i] = $field;
     
    6261        }
    6362       
    64         $this->group->fields = $fields;
     63        $this->group->fields = apply_filters( 'xprofile_group_fields', $fields, $this->group->id );
     64        $this->field_count = count( $this->group->fields );
    6565       
    6666        return $this->group;
     
    178178   
    179179    $profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id );
    180    
    181     return $profile_template->has_groups();
     180    return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template );
    182181}
    183182
Note: See TracChangeset for help on using the changeset viewer.