Skip to main content
deleted 292 characters in body
Source Link

I think what jzatt was saying should work, but I would useUse add_query_arg to make sure the url is created the right way. How is the wishlist link outputted? Trough wp_nav_menu? I would add it to the link on creation, so you don't have to use wp_redirect.

$current_user = wp_get_current_user();    
if ( is_user_logged_in() && !isset( $_GET['user'] ) ) {
   
    $url = add_query_arg( array( 'user' => $current_user->user_login ), get_permalink('redirect_page_id') );

    wp_redirect( $url ); 

    exit;
}

I think what jzatt was saying should work, but I would use add_query_arg to make sure the url is created the right way.

$current_user = wp_get_current_user();    
if ( is_user_logged_in() && !isset( $_GET['user'] ) ) {
   
    $url = add_query_arg( array( 'user' => $current_user->user_login ), get_permalink('redirect_page_id') );

    wp_redirect( $url ); 

    exit;
}

Use add_query_arg to make sure the url is created the right way. How is the wishlist link outputted? Trough wp_nav_menu? I would add it to the link on creation, so you don't have to use wp_redirect.

Post Undeleted by Lasse M. Tvedt
Post Deleted by Lasse M. Tvedt
Source Link

I think what jzatt was saying should work, but I would use add_query_arg to make sure the url is created the right way.

$current_user = wp_get_current_user();    
if ( is_user_logged_in() && !isset( $_GET['user'] ) ) {
   
    $url = add_query_arg( array( 'user' => $current_user->user_login ), get_permalink('redirect_page_id') );

    wp_redirect( $url ); 

    exit;
}