I am new to BuddyPress so I don’t know which functions and variables to use here.
Read the codex – for example:
http://codex.buddypress.org/developer-docs/the-bp-global/
You could create a function in your theme- functions.php or in bp-custom.php
and call it from template files
and pass it parameters like allowed_users, etc.
Or you code hard-code something like this into specific template files.
global $bp;
$allowed_users_array = (1,4,5,7);
if (in_array($bp->loggedin_user->id, $allowed_users_array)) {
// Show page
} else {
// "You are not allowed to view this page" message
// or load a custom error page using locate_template( array( 'some.php' ), true );
// or redirect somewhere by using bp_core_redirect( );
}
Related Posts:
- multi page password protection
- Private pages that work when you are not logged into WP admin
- Is there a way to create a URL (new WP page) that can only be accessed from a specific source?
- List all private pages user has access rights to read
- Can’t locate a hidden private page
- How to update the counter of private pages in the dashboard?
- Bad pages redirection
- Make “default” wordpress pages & features unaccessible
- 404.php only works if I’m logged in. Everybody else redirects to wp-login.php – why?
- Creating new page/tab in groups section not working! [closed]
- Embedding Password Protected (Private) “Blog Posts” BLOCK that shows Images and Excerpts on Password Protected Page (not the home page)
- How to hide a page in wordpress made for menu
- Microsoft Security Essentials is blocking my WordPress website in IE11
- Using pre_get_posts on true pages and static front pages
- How to get page title with the page ID?
- Is there a way to change the default page template selection?
- Can I have two child pages of different parents with the same name?
- Replace Dashes Before Title in Page List
- Proper method to restrict non logged users into certain pages
- WordPress parent select need to be removed
- How to get the specific Page’s current ID and use it in a get_page function?
- How does wordpress calculate the page depth?
- foreach error on false boolean from get_terms
- How to get a feed for post type ‘page’?
- Show TwentyEleven header image only on home page
- Show different badge based upon the user role
- Placing google maps into a wordpress page using the wordpress page editor
- Export only pages and posts with mysql dump
- Backend option to include a javascript file on specific pages?
- Template for child pages / subpages
- Show a special message for private page?
- Custom page template not working
- Visiting Webpage ONLY after another page was visited. Possible?
- How do I pass data from page content to the underlying PHP template
- How to open a phpBB forum in the same website as sub-page [closed]
- Display page contain in index.php file
- How to redirect login and register pages
- How to setcookie if is_page(‘page’) ? should I use add_action(‘init’) or there is another action?
- Why do pages in WordPress have a hierarchy but menu’s also have a hierarchy?
- Text Editor Tags
- Column Images Showing Gaps
- Custom page template with entirely different design. Is it possible in?
- A static page view call every custom page templates
- Wrapping images in tags based on size
- Get the ID of the direct parent page
- External stylesheet per page
- Edit Parent page drop menu when creating a page
- Get parent of current page
- How to list a page tree?
- How to create a page and display only the posts with a specific custom field value?
- Attachment pages stealing page slugs
- How to add an external php page with wordpress?
- Remove comment section from new page
- Exclude pages by menu order
- WordPress pages not working out correctly with HTML
- Change page name in admin list
- How to exclude authors from get_pages()
- Folder wordpress page redirect
- Dynamic page with comments
- How to rewrite a page url
- Manage content on multiple pages synchronysly?
- Display pages in alphabetical order
- Print page content with formatting when doing custom SQL query
- Listing all child-pages of a parent-page on the parent-page and each child-page?
- Loading scripts on specific pages using PHP in footer.php
- How to recover pages from site with only ftp? [closed]
- get_page() – Only variables can be passed by reference
- Need Help with Custom ModRewrite
- How does wordpress link page templates to individual pages
- upgrade has caused page content to disappear
- Website jumps to top when scrolling down
- How to fix broken URL – https://mywebsite.com/comments/feed/
- Translate dashboard metabox
- Revert a Draft page to its original version
- Loading ACF Field content on a 404.php page
- My edits are not saved
- Can I use the wordpress loop in pages?
- Add addtional page parameter before loading the page
- When would it be best to hook AJAX functions on a back-end page?
- Detecting if I’m on a single, non-post, non-homepage page?
- How to insert current user ID in a shortcode?
- Make wordpress pages accessible for Woocommerce logged in users only
- My AJAX requests take 30 seconds to complete
- How to show the view more on my display of pages shortcode
- Have subdirectory name act as $_GET or $_POST data
- Create page excerpts for landinpage
- Why my site scroll top when end load pages
- Cannot add media to a page
- Specify parent page template
- How to make page navigation just below the content?
- Hide if subpages are shown
- Paginate Links not working
- How to get from sql query page id and retrieve it url and title
- WP-navi plugin and post sorted alphabetically
- Tags are automatically converted if they match post names. Stop It!
- Find Page Last Modified at Certain Date & Time
- exclude page element from specific pages
- Save search criteria per user and show on custom user page
- page title showing twice [closed]
- Need pages with same names in multiple subdirectories