Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@CodeCurosity CodeCurosity commented Dec 7, 2018

Excellent, Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.