0
$uri= $_SERVER['REQUEST_URI'];

wp_logout_url($uri) having two redirect values like this

http://localhost/sarkari/wp-login.php?action=logout&redirect_to=%2Fsarkari%2F&_wpnonce=b5e3b954df&redirect_to=http://localhost/sarkari/2017/06/01/new-sample-post/

but i want only first one redirect_to value and remove or trim the another redirect_to value.

i want this http://localhost/sarkari/wp-login.php?action=logout&redirect_to=%2Fsarkari%2F&_wpnonce=b5e3b954df

  • If you want to remove part of URL... just remove part of URL? I am not quite following what is causing it to have to redirects, maybe you could elaborate a bit on the context. – Rarst Jun 2 '17 at 9:05
  • can't remove the URL – Jay Kapoor Jun 2 '17 at 9:43
  • Do you have any plugins installed? The default behavior of wp_logout_url() is to use add_query_arg() which will correctly modify a query arg rather than append it, unless some other plugin (or possibly theme function) is modifying it incorrectly, possibly via the logout_url filter. – totels Jun 2 '17 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.