• Resolved shashwata2003

    (@shashwata2003)


    Can I redirect an user after registration to an another page with specific query parameters.
    What I want to say is, If I had a field with name “mobile”, So can I redirect to an url e.g. https://example.com?number=mobile.

    I have to accomplish some GET and POST request, that’s why I am asking you the question.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @shashwata2003

    You can change the redirection in the User Role settings. Please go to WP Admin > Ultimate Member > User Roles > Edit a role > Registration Options > “Action to be taken after registration ” > select “Redirect to URL”.

    If you need to dynamically change the redirection URL, you need to customize it.
    You can try this code snippet:

    add_action("um_registration_after_auto_login","um_111921_dynamic_url_redirection");
    function um_111921_dynamic_url_redirection( $user_id ){
       $url = site_url();
       um_fetch_user( $user_id );
       $url = $url ."?number=" . um_user("mobile_number");
       exit( wp_redirect( $url ) );
    }

    The above code will only work when the Registration settings have an auto-approve.

    Regards,

    Thread Starter shashwata2003

    (@shashwata2003)

    Where do I add this file. Please reply.
    What, I know is, I have to add the code snippet in theme functions.php file right.

    • This reply was modified 3 years, 3 months ago by shashwata2003.
    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @shashwata2003

    Yes, you can add it to your theme/child-theme’s functions.php file. I also recommend using the Code Snippet plugin for all the custom codes to your site.

    Regards,

    Thread Starter shashwata2003

    (@shashwata2003)

    Thanks a lot for helping me out.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Thanks for letting us know.

    Regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can I redirect with specific parameters’ is closed to new replies.