Hi,
It’s not working, please test again. This is not an issue with cache/cookies as changing this line of code in you plugin fixes my use case.
So, to elaborate, when using wp_logout_url( home_url('/') )
the user is not redirected back to the site’s front page after logout. They are redirected to WP’s login page at /wp-login.php
.
This is because you filter the URL returned by wp_logout_url()
and change it to /?logout=<NONCE>&redirect_to=...
.
You then process that request parameter logout
like this:
function logout()
{
if (isset($_REQUEST['logout']) && wp_verify_nonce(wpdm_query_var('logout'), NONCE_KEY)) {
wp_logout();
wp_safe_redirect(wpdm_login_url());
die();
}
}
As you can see, you are completely ignoring the redirect_to
parameter.
-
This reply was modified 4 years, 4 months ago by
Vin Cit.