Skip to content

Commit

Permalink
remove single profile group tab from edit profile page
Browse files Browse the repository at this point in the history
this corresponds to (mostly) accepted pull request at
cuny-academic-commons/cbox-theme#206
so it can be removed in a little while
  • Loading branch information
JonathanReeve committed Jun 16, 2014
1 parent bbd53bb commit 4044b50
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
13 changes: 13 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,16 @@ function mla_remove_forum_subscribe_link($link){
function mla_remove_forum_title($title) {
}
add_filter( 'bbp_get_forum_title', 'mla_remove_forum_title' );

/*
* Remove profile group tab from edit profile page when there's only one profile
* group. I just says "Profile" and is kind of confusing.
*/
function mla_remove_profile_group_tab($tabs, $groups) {
if ( count( $groups ) > 1 ) {
return $tabs;
} else {
return;
}
}
add_filter( 'xprofile_filter_profile_group_tabs', 'mla_remove_profile_group_tab' );
8 changes: 5 additions & 3 deletions members/single/profile/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@

<h4><?php printf( __( "Editing '%s' Profile Group", "buddypress" ), bp_get_the_profile_group_name() ); ?></h4>

<ul class="button-nav">
<?php if ( bp_profile_group_tabs() ): ?>
<ul class="button-nav">

<?php bp_profile_group_tabs(); ?>
<?php bp_profile_group_tabs(); ?>

</ul>
</ul>
<?php endif; ?>

<div class="clear"></div>

Expand Down

0 comments on commit 4044b50

Please sign in to comment.