• Resolved cityjohn

    (@cityjohn)


    I’m having some annoying difficulty with customizer where it’s messing up my custom redirect codes. I have an elementor pro menu item which is redirecting the logout menu item to:

    https://website.nl/login/?action=logout

    But with login customizer turned on it sends everyone to this instead:

    https://website.nl/login-customizer/?action=logout

    Which is an empty page… not cool because it also does not log out the user any longer and I don’t want people seeing that link at all.

    I’ve tried to raise the priority of my custom php redirect snippets but nu luck there..

    How can I fix this without deleting login-customizer?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Miha

    (@mplusb)

    Hi @cityjohn,

    Thanks for reaching out!
    Can you please let me know what custom code are you using for the redirecct? Or how you implemented that custom redirect?
    I want to investigate further and replicate this on my end.

    Thank you,
    Mihaela

    Thread Starter cityjohn

    (@cityjohn)

    I have to dissapoint you, we’ve been changing a lot on the website and I can’t tell you exactly how to replicate it. The redirect is currently done by:

    add_action('check_admin_referer', 'scratchcode_logout_without_confirm', 10, 2);
    function scratchcode_logout_without_confirm($action, $result){
        /**
        * Allow logout without confirmation
        */
        if ($action == "log-out" && !isset($_GET['_wpnonce'])):
            $redirectUrl = 'https://website.nl/'; 
            wp_redirect( str_replace( '&', '&', wp_logout_url( $redirectUrl.'?logout=true' ) ) );
            exit;
        endif;
    }

    Which now seems to work but I can still reach the page if I go to website/login. I changed the standard links with a plugin called hide-my-WP. Can I disable this redirect somewhere in Customizer? Because no matter what why would I want people to see an empty login customizer page… In hide-my-WP an option is set to show a 404 page when people try to reach /login.

    Miha

    (@mplusb)

    Thank you!
    Just to make sure I understand correctly, are you talking about the redirect in the Customizer? Or a redirect for users that are trying to login on the site?
    Could you please also send me the site’s url?

    Warmly,
    Mihaela

    Miha

    (@mplusb)

    Marking this support thread as resolved due to inactivity. If you have any other questions or need further help please open a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Customizer stops logout redirect’ is closed to new replies.