I would like to control who can see a page in BuddyPress and restrict anyone else from accessing it.
Something along the lines of the following pseudocode:
<?php if ( loggedin_user_ids==1,4,5,7 ) { ?>
// Show page
<?php } else { ?>
// "You are not allowed to view this page" message
<?php } ?>
So basically, I need:
To be able to control who can see the page, not just any logged in user.
I also need to control which pages this applies to, not just any page.
I am new to BuddyPress so I don't know which functions and variables to use here.
I imagine something like this could be done in the template files, or maybe in the bp-custom.php file. Or is there a better solution to this?