Change login url add listing page

This topic contains 2 replies, has 2 voices, and was last updated by  Kor 4 years, 1 month ago.

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

Open Support Ticket
  • Author
    Posts
  • #539717

    mistermeij
    Expired Member
    Post count: 16

    Hi,

    When having this function disabled:

    Allow posting without logging in? If checked non logged in users will be able to post listings from the frontend.

    Then on this page: /add-listing/?listing_type=gd_place

    The user gets a message to either login or register. If the user chooses to login from this page it’s being redirected to the WP admin login page. I really need to have this set to a dedicated login page and not the wp-admin. Where can we change this?

    //Dirk

    #539718

    mistermeij
    Expired Member
    Post count: 16

    Never mind, I’ve added the following snippet and seems to work:

    function frontend_login_url( $url, $redirect, $force_reauth ){
        $new_login_url = home_url( '/register/?type=login' );
    
        if ( !empty($redirect) ){
            $new_login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $new_login_url );
        }
    
        if ( $force_reauth ){
            $new_login_url = add_query_arg( 'reauth', '1', $new_login_url ) ;
        }
        return $new_login_url;
    }
    add_filter( 'login_url', 'frontend_login_url', 10, 3 );

    Maybe it helps someone else.

    //Dirk

    #539735

    Kor
    Moderator
    Post count: 16516

    hi Dirk,

    Thanks for letting us know.

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

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

Open Support Ticket