I noticed a small issue in WordPress 2.7 when I was designing a login bar at the top of a client’s site and the logout link would not log the user out. I had coded the same way I had coded a logout button in the past, but it wouldn’t function properly. That is because WordPress 2.7 uses a new function to log a user out.

Here is the code I use to use:

<a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout">Logout</a>

And here is the new code I now use:

<a href="<?php echo wp_logout_url() ?>">Logout</a>

And here is a little bit of spice to make it redirect back to the current page:

<a href="<?php echo wp_logout_url(get_permalink()); ?>" >Logout</a>

Nore: If you are using an theme that was designed before 2.7, you should go into your comments.php file and change the anchor tag around line 78 to fix your Logout link.