• Resolved alezucchi

    (@alezucchi)


    Hello
    if a user already logged in lands on registration page, we would want it to be redirected to another page, for example “my account” page.

    I’m not talking about after form submission redirect, just a simple redirect if user is logged in

    Thank’s in advance

    AZ

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @alezucchi,

    Sorry for the delay,

    Please add the following code on your theme’s functions.php file, or you can use the code snippet plugin (This plugin will help you secure the site while adding programming codes and make your customization code safe from updates) to redirect the logged-in users.

    add_action("init", "ur_set_redirect_url");
    function ur_set_redirect_url( ){
         $url = "https://unionereali.it/my-account/"; //change the the link according to your requirement
        $page_slug = trim( $_SERVER["REQUEST_URI"] , '/' );
        if( is_user_logged_in() && "registration" === $page_slug ) {
            wp_redirect( $url );
            exit;
        }
    }

    Regards!

    Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi Alezucchi,

    We are not getting any response from your site, so we are marking this thread as resolved as we believe the things mentioned here are now resolved. Please create a new support thread if needed.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect from registration page to another if user is already logged in’ is closed to new replies.