Making wiki members-only?
- This topic has 1 reply, 2 voices, and was last updated 3 years, 6 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Is it possible to make the site-level wiki accessible only by logged-in members? I am using a plugin that can make certain BuddyPress components and WordPress pages private, but it does not seem to work for /wiki/ for some reason.
You would have to use a code snippet to restrict the sitewide wiki page to logged-in members only.
The following would work in your theme’s functions.php or in wp-content/plugins/bp-custom.php:
add_action( 'template_redirect', function() {
if ( ! is_user_logged_in() && function_exists( 'bpdw_is_wiki_home' ) && bpdw_is_wiki_home() ) {
auth_redirect();
}
} );
This redirects logged-out users that land on the sitewide wiki page to the login page.