Definition:
function wp_logout_url($redirect = '') {}
Returns the Log Out URL.
Returns the URL that allows the user to log out of the site
Parameters
- string $redirect: Path to redirect to on logout.
Defined filters
- logout_url
apply_filters('logout_url', $logout_url, $redirect)
Source code
function wp_logout_url($redirect = '') {
$args = array( 'action' => 'logout' );
if ( !empty($redirect) ) {
$args['redirect_to'] = urlencode( $redirect );
}
$logout_url = add_query_arg($args, site_url('wp-login.php', 'login'));
$logout_url = wp_nonce_url( $logout_url, 'log-out' );
return apply_filters('logout_url', $logout_url, $redirect);
}
3889

February 12, 2011 


No comments yet... Be the first to leave a reply!