Redirect logged in users
-
Hello everyone, my first post here in need of assistance, hope you can help me out.
My “home” page is the register page for users without login.
If they are logged in, I want to redirect them to the activity page. Like this example: http://localhost/website/members/USERNAMEI am using this code for the redirect in bp-custom.php
<?php function bbg_bp_loggedin_register_page_redirect_to( $redirect_to ) { if ( bp_is_component_front_page( 'register' ) ) $redirect_to = bp_get_root_domain() . '/members/USERNAME_HERE'; return $redirect_to; } add_filter( 'bp_loggedin_register_page_redirect_to', 'bbg_bp_loggedin_register_page_redirect_to' ); ?>
This is not working because I don’t know how to add the logged in username to the redirect after /members/USERNAME_HERE
Thank you in advance,
MKTGP
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.