Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CodeCurosity/68d537d4d78fb9845166a4c642717e53 to your computer and use it in GitHub Desktop.
Save CodeCurosity/68d537d4d78fb9845166a4c642717e53 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' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment