Skip to:
Content

BuddyPress.org

Changeset 3663


Ignore:
Timestamp:
01/05/2011 10:45:41 PM (16 years ago)
Author:
djpaul
Message:

Add filter to bp_profile_group_tabs(). Fixes #2996

File:
1 edited

Legend:

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

    r3650 r3663  
    618618                $group_name = bp_profile_group_name(false);
    619619
     620        $tabs = array();
    620621        for ( $i = 0; $i < count($groups); $i++ ) {
    621                 if ( $group_name == $groups[$i]->name ) {
     622                if ( $group_name == $groups[$i]->name )
    622623                        $selected = ' class="current"';
    623                 } else {
     624                else
    624625                        $selected = '';
    625                 }
    626 
    627                 if ( $groups[$i]->fields )
    628                         echo '<li' . $selected . '><a href="' . $bp->displayed_user->domain . $bp->profile->slug . '/edit/group/' . $groups[$i]->id . '">' . esc_attr( $groups[$i]->name ) . '</a></li>';
    629         }
     626
     627                if ( $groups[$i]->fields ) {
     628                        $link = $bp->displayed_user->domain . $bp->profile->slug . '/edit/group/' . $groups[$i]->id;
     629                        $tabs[] = sprintf( '<li %1$s><a href="%2$s">%3$s</a><li>', $selected, $link, esc_html( $groups[$i]->name ) );
     630                }
     631        }
     632
     633        $tabs = apply_filters( 'xprofile_filter_profile_group_tabs', $tabs, $groups, $group_name );
     634        foreach ( (array)$tabs as $tab )
     635                echo $tab;
    630636
    631637        do_action( 'xprofile_profile_group_tabs' );
Note: See TracChangeset for help on using the changeset viewer.