Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Authentication check on non-WP page


Ashfame
Participant

@ashfame

Why not load the bbPress environment and then call function to check is user is logged in? I have done the same in WP, so I think it might be possible in bbPress very easily too.

For WP

// load the WP environment so that I can call on the WP functions to make sure that user is logged in before accessing members area
require( dirname(__FILE__) . '/wp-load.php' );

if (!is_user_logged_in()) // You can't access the members area without login. Now can you?
{
auth_redirect();
}

For bbPress, it should be like

require('./bb-load.php');
// find the name of the function you will need

Skip to toolbar