• Resolved martinpweb

    (@martinpweb)


    Am creating a Membership WordPress website using Ultimate Member Plugin. When a user registers, an activation link is sent to their email address. Once the link is clicked, I have set on ultimate member dashboard to redirect to a specific URL.

    The URL is a page that has a modal where the user can finish setting up their account details.

    The problem is once the user clicks on the Activation link on the email, the url opened on the activation page does not have any unique parameter e.g user_id that can be used to fetch user details from database and update the specific record once the updates are complete .

    Am expecting this URL: https://wplocaltheme.test/user_id=31 but I get this: https://wplocaltheme.test , once I click on the activation link

    I have tried using WordPress Hooks specifically um_activate_url as seen in your documentation but still not found a solution

    Please assist?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • @martinpweb

    If you have set the Role “Login user after validating the activation link?” to true you can use get_current_user_id()

    Thread Starter martinpweb

    (@martinpweb)

    Hi @missveronicatv

    Thank you for your response, Yes , I have set the Role “Login user after validating the activation link?” to true. However, I have the code below in my functions.php file. I want the user_id to be appended at the end of url after the activation link is clicked

    //Change Activation Link

    function change_url( $url ) {

        $user_id = get_current_user_id();

        $url_new = ‘https://wplocaltheme.test/’ . $user_id;

        return $url_new;

    }

    add_filter( ‘um_activate_url’, ‘change_url’, 10, 1 );

    Seems not to work

    @martinpweb

    $url_new = 'https://wplocaltheme.test/your_page/?user_id=' . $user_id;

    Thread Starter martinpweb

    (@martinpweb)

    Hi @missveronicatv

    I have copied your code and tested it, am getting the activation email. Once I click on the activation link, it opens this URL on a different tab: https://wplocaltheme.test/activate

    Am not sure why it did not append the user_id to something like this: https://wplocaltheme.test/activate/user_id=23 ,so that I can retrieve the user_id using some Javascript and fetch the record from the database based on user_id ?

    Thread Starter martinpweb

    (@martinpweb)

    Hi @missveronicatv

    Could it be that the um hides the user_id once the activation link is clicked. Cause when I hover over the activation link in my email (I can see the url contains user_id at the bottom left corner of the screen).

    Immediately I click the activation link and it opens on a new tab the user_id disappears on the url.

    Plugin Support andrewshu

    (@andrewshu)

    Hi @martinpweb

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Fetching parameters from activated link in WordPress ultimage member plugin’ is closed to new replies.