• Resolved nebrekab

    (@nebrekab)


    Is it possible to set the user’s ID within the login redirect url? I see that the username is available, but I would also think the user’s ID should be available, too?

    e.g.

    https://mywebsite.com/members/15/profile/

    could be set as the url

    /members/[variable]userid[/variable]/profile/

Viewing 1 replies (of 1 total)
  • Thread Starter nebrekab

    (@nebrekab)

    aha! Nothing like reading the documentation and actually engaging your brain…

    Easily possible via custom url variables:

    // user id variable
    function customRULVariableUserId( $custom_redirect_to, $variable, $user )
    {
        if( 'userid' === $variable )
        {
            return $user->ID;
        }
        else
        {
            return $custom_redirect_to;
        }
    }
    
    add_filter( 'rul_replace_variable', 'customRULVariableUserId', 10, 3 );
    • This reply was modified 6 years, 6 months ago by nebrekab.
    • This reply was modified 6 years, 6 months ago by nebrekab.
Viewing 1 replies (of 1 total)
  • The topic ‘Redirect with user’s ID in the URL?’ is closed to new replies.