Reply To: Using Redirect to make single link for buddypress dynamic links
I edited the code and now it is working as it should be. So, the final code is –
function my_redirect() {
if ( is_page( 'me' ) && is_user_logged_in() )
bp_core_redirect( bp_loggedin_user_domain() );
}
add_action( 'wp', 'my_redirect' );
I have replaced
add_action( 'template_redirect', 'my_redirect' );
with
add_action( 'wp', 'my_redirect' );
Thanks for your help, @henrywright & @shanebp
Just wanted to ask another question. If I want a single link to redirect to other things like notifications, then all I need is to do is this right,
bp_core_redirect( bp_loggedin_user_domain() . '/notifications' );
Thanks!