Use wp_redirect to add a parameter


I am trying to add a function to my child theme to append the currently logged user as a parameter. For example, when the user test1 logs in and clicks on the following page:

I want her to be redirected automatically to

So far I did the following but it ends in a loop:

$current_user = wp_get_current_user();    
if ( is_user_logged_in() ) {
    wp_redirect( ''.$current_user->user_login );   

I would appreciate some help. Thank you

, ArisF 11 months 0 Answers 65 views 0

Leave an answer