Redirect on Business Owner/Claim Listing

This topic contains 4 replies, has 2 voices, and was last updated by  Dylan 8 years, 4 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #64952

    Dylan
    Expired Member
    Post count: 40

    Hello,

    I read the post here https://wpgeodirectory.com/support/topic/redirecting-is-not-working-after-the-update, and added the geodir_login_url filter to redirect.

    When selecting ?Business Owner?, the URL variables are not being appended to the redirected URL.

    How would the filter be modified to add the URL variables?

    P.S. – I see Stiofans answer here https://wpgeodirectory.com/support/topic/redirecting-is-not-working-after-the-update/#post-63756 about the function, but I am not able to get it to work.

    Thanks.

    #65122

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Dylan,

    Firstly everything should just work if you have everything upto date and are using the standard GD login forms. The reply you mentioned by me was for a customers custom login page redirect.

    If your standard redirect is not workng firstly make sure everything is updated, and then if still not working provide wp-admin and FTP so we can debug.

    If i have misunderstood something, please explain exactly what you are trying to do.

    Thanks,

    Stiofan

    #65148

    Dylan
    Expired Member
    Post count: 40

    Hi Stiofan,

    Yes, this was for a custom login page redirect. I have the redirect working fine, except when doing a ‘claim listing’ via the Business Owner link.

    It redirects to my custom login page, but does not carry the /?redirect_to, with the path back to the food truck.

    So for example, the normal URL that is given when claiming a listing (clicking on ?Business Owner), is something like:

    http://mysite.com/gd-login/?redirect_to=http%3A%2F%2Fmysite.com%2Fplace%2Faustin%2Fpizza-2%2Fcool-pizza-place%2F%3Fgd_go%3Dclaim

    When I use this redirect code

    
    
    add_filter('geodir_login_url','change_geodir_login_url',10,3);
    function change_geodir_login_url($login_url,$args,$gd_page_id){
    //change the url to whatever you want.
    $login_url = 'http://mysite.com/my-login-page';
    return $login_url;}

    it does redirect me to http://mysite.com/my-login-page/, but does not append the URL variables for the claimed listing – /?redirect_to=http%3A%2F%2Fmysite.com%2Fplace%2Faustin%2Fpizza-2%2Fcool-pizza-place%2F%3Fgd_go%3Dclaim

    What do i need to do to have the claim listing redirect to my login page, WITH the URL variables for the listing appended?

    Thanks for the help!

    #65433

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Dylan,

    Thanks for the info, please try this code:

    
    
    add_filter('geodir_login_url','change_geodir_login_url',10,3);
    function change_geodir_login_url($login_url,$args,$gd_page_id){
        //change the url to whatever you want.
        $login_url = 'http://mysite.com/my-login-page';
        //add query args back
        if($args){
            $login_url = add_query_arg($args,$login_url );
        }
    
        return $login_url;
    }

    Thanks,

    Stiofan

    #65443

    Dylan
    Expired Member
    Post count: 40

    Hi Stiofan,

    That worked great. Thank you, and have a great new year.

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

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

Open Support Ticket