Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: The Display Name stopped working

Trent… don’t remember where I picked it from it’s called the Force-login… did someone here give me the code and I copied and pasted it… not sure… here’s the code…

<?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['REQUEST_URI'], '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( 'bb_init', 'force_login_init' );
?>

Haven’t checked it the bbpress-integration (bbpress-wp same users share) is working or not.

Skip to toolbar