Fix Log Out Url

wp_redirect( wp_logout_url( $foo ) ); would redirect me to /wp-login.php?action=logout& amp;redirect_to=%2Fabout%2F.

Author:Neo Wang (profile at wordpress.org)
WordPress version required:3.0.1
WordPress version tested:3.8
Plugin version:1.0
Added to WordPress repository:17-12-2013
Last updated:19-12-2013
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:http://www.wordpress.com/plug-ins/fix-logout-...
Total downloads:571
Active installs:10+
plugin download
Click to start download

I had a site that has two parts running two servers. I need to log out WP after log out the first part, here is my javascript:

function sign_out(){ $.ajax({ type:”DELETE”, url: “/sign_out”, success: function(){ location.href = “”; }, failure: function(){ alert(“There is an error”); } }); }

The problem is the url wp_logout_url() generates has & amp; instead of &, and that cause WordPress display a page asking user to confirm logout and it stays on that page even if user confirms.

So this plugin solves the problem by replaceing & amp; with &.

The code was written by mrlarner at this post http://wordpress.org/support/topic/wp_logout_url-not-redirecting. I just put it in this plugin for convenience.