Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Using Redirect to make single link for buddypress dynamic links

@chatty24

Participant

@henrywright

Because on my website the usernames are on the root. That is —> example.com/username.
I removed . '/members/' from the code. So, the final code was –

function my_redirect() {
    if ( is_page( 'me' ) && is_user_logged_in() ) {
        $user = get_userdata( get_current_user_id() );
        bp_core_redirect( home_url() . $user->user_login );
    }
}

But it took me to the /wp-admin/. Is there something wrong that I am doing?

Thanks

Skip to toolbar