Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Cannot login, Hide forum

zapata, this plugin.

<?php

/*

Plugin Name: Force Login

Description: No one can see your forums unless they are logged in.

Plugin URI: https://bbpress.org/forums/topic/117

Author: Michael D Adams

Author URI: http://blogwaffe.com/

Version: 0.7

*/

function force_login_init() {

if ( !bb_is_user_logged_in() && false === strpos($_SERVER, ‘bb-login.php’) ) {

if ( file_exists( BBPATH . ‘my-templates/login.php’ ) ) {

require( BBPATH . ‘my-templates/front-page.php’ );

} else {

require( BBPATH . ‘bb-templates/front-page.php’ );

}

exit;

}

}

add_action( ‘init’, ‘force_login_init’ );

?>

Skip to toolbar