Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Error 404 for non logged in users

@peterspliid

Participant

I had the same issue, and since I couldn’t find a solution, I had to make one myself. I thought I’d share.

Add the following to your functions file

function fix_private_message_login() {
    Global $bp;
    if (isset($bp->canonical_stack['component']) && $bp->canonical_stack['component'] == 'messages' && !is_user_logged_in()) {
        header('Location: ' . get_site_url() . '/wp-login.php?redirect_to=' . $_SERVER['REQUEST_URI']);
        die();
    }
}
add_action('bp_do_404', 'fix_private_message_login');

If you’re admin, you will most likely be redirected to the admin panel after login (instead of the message), however for all other users, it will redirect you to the message.

Skip to toolbar