Query string through url after redirect_to

This topic contains 8 replies, has 4 voices, and was last updated by  Stiofan O’Connor 8 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #170714

    EH
    Expired Member
    Post count: 96

    I’m trying to pass some variables through a query string in the url from the register page to the add listing page. Because of the redirect I’m having a hard time figuring out where to put this if I put the ?var1=testing&var2=testing2 after the redirect I get a syntax error. Can anyone point me the right direction?

    #170818

    Paolo
    Site Admin
    Post count: 31206

    Hi Danielle,

    this is really beyond support. I’ll ask to the developers if they can look into it, but I can’t promise anything.

    Thanks

    #170972

    Giri
    Expired Member
    Post count: 3155

    Hi Danielle,

    can you give me your ftp details and also give me the code you tried so far?

    Thanks

    #171036

    EH
    Expired Member
    Post count: 96
    This reply has been marked as private.
    #171039

    Giri
    Expired Member
    Post count: 3155

    You cannot use like this

    
    
    <?php echo htmlspecialchars($redirect_to);?><?php echo ?var1=testing&var2=testing2;?>
    

    You have to use this function.

    https://developer.wordpress.org/reference/functions/add_query_arg/

    So in your case it should be

    
    
    value="<?php echo add_query_arg( array(
        'var1' => 'testing',
        'var2' => 'testing2',
    ), htmlspecialchars($redirect_to) ); ?>"

    I’m not sure what you are trying to achieve is gonna work or not. But good luck.

    #171108

    EH
    Expired Member
    Post count: 96

    This didn’t exactly work but I think I know why. I need to edit this line of code:

    
    
     if (isset($_REQUEST['redirect_add_listing']) && $_REQUEST['redirect_add_listing'] != '') {
     
                           $redirect_to = $_REQUEST['redirect_add_listing'];
                        }

    in geodirectorygeodirectory-functionssignup_function.php

    I’m assuming I can’t just copy this into my child theme and make modifications right?

    #171109

    Giri
    Expired Member
    Post count: 3155

    Yes you cannot copy and modify that file.

    Sorry about that

    #171112

    EH
    Expired Member
    Post count: 96

    Is there a filter to remove that redirect from signup_function.php?

    #171214

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I am not sure what you are trying to achieve but you can use the filter here to do whatever you want after signup/signin
    https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-functions/signup_function.php#L599

    Thanks,

    Stiofan

Viewing 9 posts - 1 through 9 (of 9 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount