Skip to content

Instantly share code, notes, and snippets.

@mustardBees
Created February 4, 2013 14:41
Show Gist options
  • Save mustardBees/4707078 to your computer and use it in GitHub Desktop.
Save mustardBees/4707078 to your computer and use it in GitHub Desktop.
Allows you to place a logout link within the WordPress editor.
/**
* Return logout URL and redirect to homepage
*
* Allows you to place a logout link within the WordPress editor. In visual
* view set the link to [logout-url], in text view, use
* <a href="[logout-url]">logout</a>.
*
* @author Phil Wylie
* @link http://goo.gl/025f5
*/
function iweb_logout_url_shortcode() {
return wp_logout_url( home_url() );
}
add_shortcode( 'logout-url', 'iweb_logout_url_shortcode' );
@CodeCurosity
Copy link

Excellent, Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment