diff --git src/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php src/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php
index a20c079..be0fa56 100644
|
|
if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) |
9 | 9 | |
10 | 10 | <h4><?php printf( __( "Editing '%s' Profile Group", "buddypress" ), bp_get_the_profile_group_name() ); ?></h4> |
11 | 11 | |
12 | | <ul class="button-nav"> |
| 12 | <?php if ( bp_profile_has_multiple_group_tabs() ) : ?> |
| 13 | <ul class="button-nav"> |
13 | 14 | |
14 | | <?php bp_profile_group_tabs(); ?> |
| 15 | <?php bp_profile_group_tabs(); ?> |
15 | 16 | |
16 | | </ul> |
| 17 | </ul> |
| 18 | <?php endif ;?> |
17 | 19 | |
18 | 20 | <div class="clear"></div> |
19 | 21 | |
diff --git src/bp-xprofile/bp-xprofile-template.php src/bp-xprofile/bp-xprofile-template.php
index 111123c..5114402 100644
|
|
function bp_profile_field_data( $args = '' ) { |
589 | 589 | return apply_filters( 'bp_get_profile_field_data', xprofile_get_field_data( $field, $user_id ) ); |
590 | 590 | } |
591 | 591 | |
592 | | function bp_profile_group_tabs() { |
593 | | global $bp, $group_name; |
| 592 | /** |
| 593 | * Get group profile fields tabs |
| 594 | * |
| 595 | * @since BuddyPress (2.1.0) |
| 596 | * |
| 597 | * @uses BP_XProfile_Group::get() |
| 598 | * @return object $groups |
| 599 | */ |
| 600 | function bp_profile_get_group_tabs() { |
| 601 | $groups = wp_cache_get( 'xprofile_groups_inc_empty', 'bp' ); |
594 | 602 | |
595 | | if ( !$groups = wp_cache_get( 'xprofile_groups_inc_empty', 'bp' ) ) { |
| 603 | if ( empty( $groups ) ) { |
596 | 604 | $groups = BP_XProfile_Group::get( array( 'fetch_fields' => true ) ); |
597 | 605 | wp_cache_set( 'xprofile_groups_inc_empty', $groups, 'bp' ); |
598 | 606 | } |
599 | 607 | |
| 608 | return apply_filters( 'bp_profile_get_group_tabs', $groups ); |
| 609 | } |
| 610 | |
| 611 | /** |
| 612 | * Check if there is more than one group of fields for the profile being edited. |
| 613 | * |
| 614 | * @since BuddyPress (2.1.0) |
| 615 | * |
| 616 | * @uses bp_profile_get_group_tabs() |
| 617 | * @return bool true|false |
| 618 | */ |
| 619 | function bp_profile_has_multiple_group_tabs() { |
| 620 | $has_multiple_tabs = count( (array) bp_profile_get_group_tabs() ) > 1; |
| 621 | return (bool) apply_filters( 'bp_profile_has_multiple_group_tabs', $has_multiple_tabs ); |
| 622 | } |
| 623 | |
| 624 | /** |
| 625 | * Output the group profile fields tabs |
| 626 | * |
| 627 | * @uses bp_profile_get_group_tabs() |
| 628 | * @uses bp_profile_group_name() |
| 629 | * @uses bp_displayed_user_domain() |
| 630 | * @return string group profile fields tabs |
| 631 | */ |
| 632 | function bp_profile_group_tabs() { |
| 633 | global $bp, $group_name; |
| 634 | |
| 635 | $groups = bp_profile_get_group_tabs(); |
| 636 | |
600 | 637 | if ( empty( $group_name ) ) |
601 | 638 | $group_name = bp_profile_group_name(false); |
602 | 639 | |