Skip to content

Commit

Permalink
Remove 'Membership' tab from Portfolio groups for non-members.
Browse files Browse the repository at this point in the history
See #3401.
  • Loading branch information
boonebgorges committed Jun 26, 2024
1 parent b4d344f commit eba5b26
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions wp-content/themes/openlab/lib/menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,22 @@ function openlab_filter_subnav_members($subnav_item) {
return $new_item;
}

/**
* Only group members should have access to Portfolio 'members' nav item.
*/
function openlab_filter_subnav_portfolio_members() {
if ( ! openlab_is_portfolio( bp_get_current_group_id() ) ) {
return;
}

if ( groups_is_user_member( bp_loggedin_user_id(), bp_get_current_group_id() ) ) {
return;
}

bp_core_remove_subnav_item( groups_get_current_group()->slug, 'members', 'groups' );
}
add_action( 'bp_actions', 'openlab_filter_subnav_portfolio_members' );

add_filter('bp_get_options_nav_nav-docs', 'openlab_filter_subnav_docs');

function openlab_filter_subnav_docs($subnav_item) {
Expand Down

0 comments on commit eba5b26

Please sign in to comment.