logout_url = wp_logout_url( $custom_login_url);
echo "<a class='handler-login-link logout' href='{$logout_url}'>".__("Logout","pixel_framework")."</a>";
I have created a custom logout link that is supposed to redirect users to a custom login page (within the same domain).
Logout is working fine, but the redirection is not working at all. After logging out redirected to the default wp-login page.
I tried to inspect HTML behind the link it is like this:
https://example.com/?logout=0b2adca060&redirect_to=https://example.com/haendler-login/
https://example.com/wp-login.php?action=logout&_wpnonce=12345&redirect_to=
etc. (and the redirect-to URL urlencoded). i.e. it should use the login page to log out. Unless you have a different logout handler, and a logout_url filter from one of your plugins? I'd guess that logout handler doesn't support the redirect.