Login Form with Dynamic Redirect URL

Support MB User Profile Login Form with Dynamic Redirect URLResolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32599
    AJ TatumAJ Tatum
    Participant

    In the shortcode, you can provide a redirect URL with the redirect parameter, but is there anyway that the value could be automatically populated based on a query string? Somewhat how like WordPress' normal login links work where it includes a "redirect_to" query string parameter.

    Thanks,
    AJ

    #32630
    Long NguyenLong Nguyen
    Moderator

    Hi AJ,

    You can add the query string to the redirect URL via the PHP code, like this

    $param1 = 'dog';
    $param2 = 'cat';
    echo do_shortcode('[mb_user_profile_login redirect="http://domain.com/specificpage/?parameter1=$param1&parameter2=$param2"]');
    #35471
    David JirverusDavid Jirverus
    Participant

    Hi!

    I'm trying to create a user page to display user information.

    I have created a Page with the shortcode:
    [mb_user_profile_login]
    https://paste.pics/GLMWN

    I have also created a Page for for each user. This page contains unique information for each user, and it also have the custom field "User" from metabox. The template is build on elementor.
    https://paste.pics/GLMY9

    What I need is a shortcode where the user will be redirected to it's own page, something like:
    [mb_user_profile_login redirect="https://exemple.com/user-1/"]

    where https://exemple.com/user-1/ should be dynamic taken from the user page.

    Is this posible? If yes pls let me know how...

    / thank you for your time.

    #35527
    AJ TatumAJ Tatum
    Participant

    I ended up using a snippet instead of trying to use the short code so that it would redirect the user if there was a redirect_to in the query string. Here is an example: https://gist.github.com/ajtatum/8e20f51b1d1dfe739b59f68e64fceb96

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.