Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Make access members/groups sections members-only

I just did a quick test. In the home theme at least (wp-content/themes/bphome/header.php) the global nav at the top is already hardcoded. So it’s dead easy to hide the groups and members links simply by wrapping it with this:

<?php if(is_user_logged_in()): ?>

[ links for logged in users only go here ]

<?php endif; ?>

In my template, the “groups” and “members” links appear on lines 48-53.

Note that the last item in the navigation is:

<?php do_action( 'bp_nav_items' ); ?>This function could pulling in more navigation links if you are using any plugins… like bp-events for instance.

That said… I like the solution in this thread much better.

https://buddypress.org/forums/topic.php?id=1651&page=2

The “solution” above is very “low tech” and in fact, isn’t really a solution since it doesn’t actually restrict access… it just hides some links. Probably not a good way to go. You could probably still get into a group by… let’s say… clicking on someone’s profile link and then clicking on a link to a group they are a member of.

Skip to toolbar