Skip to content

Commit

Permalink
Show the Papers tab in all groups, regardless of whether the group ha…
Browse files Browse the repository at this point in the history
…s papers.
  • Loading branch information
boonebgorges committed Apr 25, 2016
1 parent 6fbaadb commit 2812bf6
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions includes/hooks-buddypress-group.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,25 +570,6 @@ function cacsp_get_group_links_for_paper( $paper_id ) {
return $show_groups;
}

/**
* Remove the Groups nav menu item if there are no papers in the group.
*
* Would like to do this in the BP_Group_Extension constructor, but the taxonomy is not registered in time.
*
* @since 1.0.0
*/
function cacsp_maybe_remove_papers_from_group_nav() {
if ( ! bp_is_group () ) {
return;
}

$papers_of_group = cacsp_get_papers_of_group( bp_get_current_group_id() );
if ( ! $papers_of_group ) {
bp_core_remove_subnav_item( bp_get_current_group_slug(), 'papers' );
}
}
add_action( 'bp_actions', 'cacsp_maybe_remove_papers_from_group_nav' );

/**
* Add group information to the paper meta area.
*
Expand Down

0 comments on commit 2812bf6

Please sign in to comment.